Within the IDL environment, a number of characters have special meanings.
The following table lists characters with special interpretations and states their functions in IDL. These characters are discussed further in the descriptions following the table.
The exclamation point is the first character of names of IDL system-defined variables. System variables are predefined scalar variables of a fixed type. Their purpose is to override defaults for system procedures, to return status information, and to control the action of IDL.
The apostrophe delimits string literals and indicates part of an octal or hex constant.
The semicolon is the first character of the optional comment field of an IDL statement. All text on a line following a semicolon is ignored by IDL. A line can consist of a comment only or both a valid statement and a comment.
The dollar sign at the end of a line indicates that the current statement is continued on the following line. The dollar sign character can appear anywhere a space is legal except within a string constant or between a function name and the first open parenthesis. Any number of continuation lines are allowed.
When the $ character is entered as the first character after the IDL prompt, the rest of the line is sent to the operating system as a command. If $ is the only character present, an interactive subprocess is started. Under UNIX, IDL execution suspends until the new shell process terminates.
The quotation mark precedes octal numbers, which are always integers, and delimits string constants. Example: "100B is a byte constant equal to 64 base 10 and "Don't drink the water" is a string constant.
The period or decimal point indicates in a numeric constant that the number is of floating-point or double-precision type. Example: 1.0 is a floating-point number. Also, in response to the IDL prompt, the period begins an executive command. For example,
causes IDL to compile the file myfile.pro. If myfile.pro contains a main program, the program also will be executed. In addition, the period precedes the name of a tag when referring to a field within a structure. For example, a reference to a tag called NAME in a structure stored in the variable A is A.NAME.
The ampersand separates multiple statements on one line. Statements can be combined until the maximum line length is reached. For example, the following line contains two statements:
I = 1 & PRINT, 'value:', I
The colon ends label identifiers. Labels can only be referenced by GOTO and ON_ERROR statements. The following line contains a statement with the label LOOP1.
LOOP1: X = 2.5
The colon also separates the starting and ending subscripts in subscript range specifiers. For example, A(3:6) designates elements three to six of the variable A.
The asterisk represents one of the following, depending on context:
B[*,3]represents all elements of row four of matrix B.
ptris a valid pointer (created via the PTR_NEW function), then
*ptris the value held by the heap variable that
ptrpoints to. For more information on IDL pointers, see Pointers.
The "at" sign is used both as an include character and to signal batch execution.
The "at" sign at the beginning of a line causes the IDL compiler to substitute the contents of the file whose name appears after the @ for the line. If the full path name is not specified after the @ symbol, IDL searches the current directory and a list of known locations where procedures are kept.
For example, the line
when included in a file, causes the file doit.pro to be compiled in its place. (The suffix .pro is the default for IDL program files.) When the end of the file is reached, compilation resumes at the line after the @.
When IDL is running in interactive mode, a line beginning with the character @ is entered in response to the IDL prompt and the file is opened for batch input. See Executing Batch Jobs in IDL for details.
The question mark is used as follows:
For more on conditional expressions, see Conditional Expression.