CAL has nine variables called V1, V2, ..., V9. These are
temporary storage locations you can use to move information between
form boxes and other data sources.
Variable names can be substituted in any CAL command. Any item
shown in italics in a command description may be replaced by the
name of a variable, prefixed with a dollar sign.
For example, MSG message may be either
|MSG "An explicit message"
||message explicitly coded into the script
||message taken from variable 2 at run time
You may concatenate variables and variables and literals
together in CAL commands. You must add both a leading and trailing
dollar sign to the variable name.
Displays a message box with the value of V2 immediately followed
by the value of V1.
Most commands for manipulating variables take an optional
variable number as the first argument. If the number is omitted, it
is assumed to be 1.
||Puts the specified text into a
||Reads the contents of a text file into
||Copies the contents of a variable to a
||Displays a text input dialog, accepts
data from the user and stores it in a variable. An optional prompt
string is displayed in the box when it appears.
||Is the same as INPUT, but displays all
characters as asterisks.
||Retrieves the contents of a form box
(as long as it is not a structure) into a variable; see above for
how to identify a box.
||Copies specified text into a form box.
Form names are case-sensitive. Be sure to use the same case as the
form box name into which you want to store data.
||Determines whether data in a storage
location is kept if other data is being moved there.Causes any
subsequent data movements to append new data to old.
||Causes old data to be overwritten.
This applies to all variable commands except PUTDATA. The default
at program startup is APPEND OFF.
||Is a shortcut designed to make it
easier to build string values. It is the same as setting APPEND ON,
doing a SETVAL, and then restoring APPEND to its original
||Adds 1 to the value of a variable. Use
INCREMENT in loops.
||Subtracts 1 from the value of a
variable. Use DECREMENT in loops.
|LET v v op v
- Allows you to perform mathematical operations
on variables that contain integer or real-number values. Only one
operator per line is supported. It recognizes the following
- + for addition
- - for subtraction
- * for multiplication
- / for division
|SETVAL "some text"
||store text in V1
|SETVAL V2 "other text"
||Store text in V2
|READVAL V9 tmpdata.txt
||Read text from file into V9
||Turn on append mode
||Append contents of V1 to file
|SETVAL V2 "append me"
||Append text to contents of V2
||Turn off append mode
|INPUT V2 "enter new data"
||Prompt and get user input to V2
|GETDATA V3 molname
||Copy data from molname box to V3
|PUTDATA molname "benzene"
||Store given string in molname box
|LET V3$V1+ $V4
||Sets V3 equal to the value stored in
V1 plus the value stored in V4.