|
Script-only commands are useful only in script files, not
interactive CAL.
An asterisk (*) is used to mark a line as a comment and not a
command that should be executed. For example, *text.
| Command |
Description |
GOTO label
:label
label: |
A mechanism for jumping backwards in a
script. A label may be any text string starting or ending with a
colon. It must appear prior to any GOTO that references it |
| IF v1 op v2
stmt |
A standard conditional statement. It
compares two values according to an operator, and then executes its
final statement if the result is true. Valid operators are:
=, <>, <, >. |
| LOOP [count]
|
Begins a section of code that will
execute repeatedly, until ENDLOOP is reached. By default, the
number of times the code executes is equal to the number of records
in the current list, but you can provide a specific count in the
LOOP statement. |
| PAUSE [dseconds] |
Temporarily stops the script from
executing for a specified number of tenths of a second. If no
number is given, the duration of the pause is 2 seconds. |
| EXIT |
Ends the script immediately. |
| INTERACTIVE ON /
OFF |
Turns interactive mode on or off. |
| STEP ON /
OFF |
Toggles single-step (debugging) mode
on and off. |
Examples
| Command |
Action |
| start: |
A label |
| IF $V1 = "" MSG Empty value! |
Provide an error message if the variable V1 is
empty |
| PAUSE 100 |
Pause 10 seconds |
| GOTO start |
Go to specified label |
| LOOP 10 |
Begin loop to repeat ten times |
| PAUSE |
Pause the default time: 2 seconds |
| ENDLOOP |
Return to LOOP statement until done |
|