The set command allows variables to be defined and reused in GEOD. These variables may refer to numbers, value tables, lithological patterns, fill motifs, line styles, or text styles.
The set command is a general-purpose instruction used to store information for later reuse. In other words, it is the command used to define variables.
Its general syntax is:
set variableName to objectType
Here, variableName is the name of the variable. Any identifier beginning with a letter from a-z or A-Z may be used. The identifier may also contain digits.
The parameter objectType must be one of the following keywords: var, time, pattern, fill, style, or text. These keywords define the type of variable being created.
For example,
set bajocien to pattern
creates a variable called bajocien containing all the information needed to draw a lithological pattern.
To use such a predefined pattern, one writes:
pattern with bajocien
The new variable named bajocien is what is called a predefined pattern. The main advantage of predefined patterns is that they only need to be defined once, and may then be reused as many times as needed on different layers of the cross-section.
Variables may be defined anywhere in the script. Unlike what is common in many programming languages, they may even be defined at the end of the script.
To define a simple numeric variable, one writes:
set variableName to var
value v
where v is a numeric value.
The syntax may be simplified by omitting the keyword value:
set variableName to var v
Once defined, such a variable may be used in several instructions of the commands point, line, bezier, offset, shift, and text.
With a point command, the instructions x, y, slope, leftslope, rightslope, range, leftrange, and rightrange may all be defined by variables.
Example:
set xa to var 100
set ya to var 200
point x with xa
y with ya
With a line