INCLAN: Special characters

From CYANA Wiki
Jump to navigation Jump to search

The following characters have a special meaning for INCLAN. To use them literally, they usually must be preceded by a backslash.

$
“$variable” substitutes the value of the variable in the command line. “$function(parameters)” substitutes the result value of the function with the given parameters in the command line. Substitutions proceed from left to right. If the value of the variable or function call starts and ends with single quotes (i.e. if it is a Fortran-77 character string), the delimiting single quotes are removed before inserting the value.

% “%variable” substitutes the value of the variable in the command line. Substitutions proceed from left to right. Single quotes that delimit Fortran-77 character strings are retained. { } The curly braces in “{$variable}” or “{%variable}” separate the variable name variable from immediately following text. “${expression}” or “%{expression}” substitute the result value of the FORTRAN-77 expression. ( ) “$variable(format)” uses the given FORTRAN-77 format to convert the numeric value of a variable into the string that is substituted in the command line. If the value of the variable is a comma-separated list, “$variable(n)”, where n is an integer expression, substitutes with the n-th element of this list. “$variable(m:n)”, where m and n are integer expressions, substitutes with the substring between positions m and n of the value of the variable. These three possible uses of parentheses cannot be used simultaneously.

separates commands that stand on the same line. Note, however, that commands that form blocks (e.g. do . . . end do, if . . . end if) must always appear as the first command on a line.

“Label:” denotes a label that can be used as the target of a jump in a goto statement.

\ “\c” treats the character c literally and allows the use of special characters in normal text. “\” at the end of a line indicates that the statement continues on the following line.

" "text" treats text as a single parameter, even if it contains spaces. Variable substitutions in the text still occur. ’ ’text’ treats text as a single parameter; the single quotes remain part of the text. Single quotes are used to delimit FORTRAN-77 character string constants. Variable substitutions in the text still occur.

Text between a comment sign “#” and the end of the line is treated as a comment and skipped by the program. @ Commands preceded by “@” are only echoed if the variable echo has the value full. “@” has its special meaning only if it occurs as the first character of a command. ! “!string” recalls the last interactive command that started with string. “!” has its special meaning only if it occurs as the first character of a command. ^ “^string^replacement^” executes the last interactive command again after replacing the first occurrence of string by replacement. The third caret is optional unless the replacement string has trailing blanks. “^” has its special meaning only if it occurs as the first character of a command.