This section gives a summary of the ICL language syntax. Square brackets imply that the enclosed part of the construct is optional.
Statements are executed as they are entered.
Statements are first entered into a procedure, then the procedure is executed.
See below.
| 1 | ** |
| 2 | * / |
| 3 | + - |
| 4 | = > < >= <= <> : |
| 5 | NOT AND OR & |
Normally one statement per line. A tilde (~) at the end of a line indicates that the statement continues on the next line.
These statements can be used in any operational mode.
Any line starting with the characters ‘{’ or ‘;’.
= expression (prints value of expression)
variable = expression (assignment to variable)
command_name p1 p2 …(command or procedure call)
In commands or procedure calls, parameters are separated by a comma or spaces. Expressions or variables should be enclosed in parentheses.
These statements can only be used in the Procedure operational mode.
You can escape from a loop via a BREAK statement.
The commands which are likely to be of most use in data analysis are classified below. Commands relevant mainly to data acquisition are omitted. A full list is contained in SG/5.
The following functions are available for use in expressions (N.B. The ‘’ symbol in the Type column stands for ‘Real or Integer’).
| Name | Type | Definition |
| SIN(X) | Real | Trig. functions (x in radians). |
| COS(X) | Real | |
| TAN(X) | Real | |
| SIND(X) | Real | Trig. functions (x in degrees). |
| COSD(X) | Real | |
| TAND(X) | Real | |
| ASIN(X) | Real | ; . |
| ACOS(X) | Real | ; . |
| ATAN(X) | Real | ; . |
| ATAN2(X1,X2) | Real | ; . |
| ASIND(X) | Real | Inverse trig functions in degrees. |
| ACOSD(X) | Real | |
| ATAND(X) | Real | |
| ATAN2D(X1/X2) | Real | |
| SINH(X) | Real | Hyperbolic functions. |
| COSH(X) | Real | |
| TANH(X) | Real | |
| ABS(X) | * | . |
| DIM(X1,X2) | * | Positive difference between and . |
| EXP(X) | Real | . |
| LOG(X) | Real | . |
| LOG10(X) | Real | . |
| MIN(X1,X2,...) | * | Minimum of two or more arguments. |
| MAX(X1,X2,...) | * | Maximum of two or more arguments. |
| MOD(X1,X2) | * | Remainder when is divided by . |
| SIGN(X1,X2) | * | Transfer of sign Sign . |
| SQRT(X) | Real | . |
| BIN(I,n,m) | String | Integer I formatted in binary into an n char string |
| with m significant digits. | ||
| DEC(I,n,m) | String | Integer I formatted in decimal into an n char string |
| with m significant digits. | ||
| HEX(I,n.m) | String | Integer I formatted in hexadecimal into an n char string |
| with m significant digits. | ||
| OCT(I,n,m) | String | Integer I formatted in octal into an n char string |
| with m significant digits. | ||
| DECL(S) | Real | Declination in radians from string in degrees, minutes, seconds. |
| DEC2S(R,NDP,SEP) | String | String in DMS with separator SEP and NDP decimal places |
| on seconds, from Dec in radians. | ||
| RA(S) | Real | Right Ascension in radians from a string in hours, minutes, seconds. |
| RA2S(R,NDP,SEP) | String | String in HMS with separator SEP and NDP decimal places |
| on seconds, from RA in radians. | ||
| CHAR(I) | String | Character with ASCII value I. |
| ICHAR(S) | Integer | ASCII value of first character of string S. |
| INDEX(S1,S2) | Integer | Position of first occurrence of string S2 in string S1. |
| LEN(S) | Integer | Length of string. |
| ELEMENT(I,DELIM,S) | String | Ith element of delimited string. |
| SUBSTR(S,n,m) | String | Substring of S beginning at n of length m. |
| SNAME(S,n,m) | String | Name derived by concatenating string S with integer n |
| formatted into m characters including leading zeros. | ||
| UPCASE(S) | String | String S converted to upper case. |
| LGE(S1,S2) | Logical | True if S1 S2 (ASCII collating sequence). |
| LGT(S1,S2) | Logical | True if S1 S2 (ASCII collating sequence). |
| LLE(S1,S2) | Logical | True if S1 S2 (ASCII collating sequence). |
| LLT(S1,S2) | Logical | True if S1 S2 (ASCII collating sequence). |
| IAND(I1,I2) | Integer | Bitwise AND. |
| IOR(I1,I2) | Integer | Bitwise OR. |
| IEOR(I1,I2) | Integer | Bitwise Exclusive OR. |
| INOT(I) | Integer | Bitwise Complement. |
| FLOAT(I) | Real | Integer I converted to real. |
| IFIX(X) | Integer | X converted to integer by truncation. |
| INT(X) | Integer | X converted to integer by truncation. |
| NINT(X) | Integer | Nearest integer to X. |
| INTEGER(X) | Integer | X converted to integer. |
| LOGICAL(X) | Logical | X converted to logical. |
| REAL(X) | Real | X converted to real. |
| STRING(X) | String | X converted to string. |
| TYPE(X) | String | The type of X (‘REAL’, ‘INTEGER’, ‘LOGICAL’, |
| ‘STRING’, or ‘UNDEFINED’). | ||
| UNDEFINED(X) | Logical | TRUE if X is undefined. |
| DATE() | String | Current date. |
| TIME() | String | Current time. |
| GETNBS(S) | Any | Value of noticeboard item. |
| GET_SYMBOL(S) | String | Value of DCL symbol. |
| INKEY() | Integer | Key value of last key trapped (Screen mode only). |
| KEYVALS(S) | Integer | Value of key with name S. |
| OK(stat) | Logical | True if VMS Status OK. |
| FILE_EXISTS(S) | Logical | True if file S exists. |
| RANDOM(I) | Real | Random number between 0 and 1 from seed variable I. |
| VARIABLE(proc,X) | Any | Returns value of variable X of procedure proc. |
| Name | Description |
| ADAMERR | An error has occurred in an ADAM task. An associated message will be output. |
| ASSNOTVAR | An assignment has been made to a procedure formal parameter which does |
| not correspond to a variable in the procedure call. | |
| CLOSEERR | Error closing text file. |
| CONVERR | Error converting RA or Dec to string or vice versa. |
| CTRLC | A Control-C has been entered on the terminal. |
| DEVERR | Error allocating or mounting device. |
| EDITERR | Attempt to use the LSE or TPU editors when they are not available. |
| EOF | End of file encountered on text file operation. |
| FIGERR | Error in a FIGARO program, or FIGARO not available. |
| FLTDIV | Floating point division by zero. |
| FLTOVF | Floating point overflow. |
| IFERR | The expression in an IF or ELSE IF statement does not evaluate to a logical value. |
| INTOVF | Integer overflow. |
| INVARGMAT | Invalid argument to a mathematical function. |
| INVSET | Invalid SET command. |
| LOGZERNEG | Logarithm of zero or negative number. |
| NBSERR | Error in GETNBS or PUTNBS. |
| OPENERR | Error opening text file. |
| OPNOTLOG | Operands of a logical operator (AND, OR etc.) are not logical values. |
| OPNOTNUM | Operands of a formatting operation (:) are not numeric. |
| PROCERR | Unrecognized procedure or command name. |
| READERR | Error reading from text file. |
| RECCALL | Attempt to make a recursive call of a procedure. |
| SCREENERR | Error in screen mode I/O. |
| SQUROONEG | Square root of negative number. |
| STKOVFLOW | ICL’s stack has overflowed. |
| STKUNDFLOW | ICL stack underflow — if this occurs it indicates an internal error in ICL. |
| TOOFEWPARS | Not enough parameters for a function or command. |
| TOOMANYPARS | Too many parameters for a procedure or command. |
| UNDEFVAR | Attempt to use an undefined variable — i.e. one that has not yet had a value assigned. |
| UNDEXP | Undefined Exponentiation. |
| USERERR | Error accessing a routine defined using DEFUSER, or error during such a routine. |
| WHILEERR | The expression in a WHILE statement does not evaluate to a logical value. |
| WRITERR | Error writing to text file. |