INCLAN: special characters: Difference between revisions

From CYANA Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(14 intermediate revisions by the same user not shown)
Line 1: Line 1:
The following characters have a special meaning for Inclan. To use them  
The following characters have a special meaning for INCLAN. To use them literally, they usually must be preceded by a backslash.
literally, they usually must be preceded by a backslash.


;$: '''$'''''variable'' substitutes the value of the variable in the command line.  
;$: '''$'''''variable'' substitutes the value of the variable 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.
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.  
;%: '''%'''''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.
;{ }: 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
;( ): '''$'''''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'''''('''''n''''':'''''m''''')''', 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.
      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
;&#59;: 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.
      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.
;:: ''label''''':''' denotes a label that can be used as the target of a jump.


\     "\c" treats the character c literally and allows the use of special
;\ : '''\'''''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.
      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.
;": "''text''" treats ''text'' as a single parameter, even if it contains spaces. Variable substitutions in the text still occur.
      Variable substitutions in the text still occur.


'''     '''text''' treats text as a single parameter; the single quotes remain  
;': '''''''''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.
      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
;#: Text between a comment sign '''#''' and the end of the line is treated as a comment and skipped by the program.
      as a comment and skipped by the program.


@     Commands preceded by "@" are only echoed if the variable echo has  
;@: 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.
      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'' 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". "!" has its special meaning only if it occurs as the  
      first character of a command.


^     "^string^replacement^" executes the last interactive command again  
;^: '''^'''''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.
      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.

Latest revision as of 11:13, 30 January 2009

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. 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(n:m), 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.
\
\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.