next up previous 63
Next: Variables
Up: Expressions
Previous: Values


Constants

Values of all four types can be represented by appropriate constants. Integer and real constants are represented by numbers written in the same formats that are accepted in FORTRAN. Integer constants may also be entered in binary, octal or hexadecimal format by preceding the value with %B, %O or %X.

Logical constants are typed as TRUE or FALSE. Note that they are not delimited by decimal points as in FORTRAN.

String constants consist of any sequence of characters enclosed in either single or double quotes. Two consecutive quote symbols in a string are used to represent a single quote. String constants are the one place in ICL where the case of letters is significant.

Some examples of constants:

    Real          1.234E-5       3.14159

    Integer       123      %B100110     %O377      %Xffff

    Logical       TRUE     FALSE

    String        'This is a string'     "So is this"      ''

The last example defines a string of zero length (valid in ICL but not in FORTRAN).


next up previous 63
Next: Variables
Up: Expressions
Previous: Values

ICL The Interactive Command Language for ADAM
Starlink Guide 5
J A Bailey
A J Chipperfield

9th June 1998
E-mail:starlink@jiscmail.ac.uk

Copyright © 2013 Science and Technology Facilities Council