Variables in the stitcher rules
Before you can use variables, you must first declare the variables in the stitcher rules.
The declaration is in the following format.
datatype name = initial_value ;
You can declare
variables anywhere within the StitcherRules{}
. Although variables
must be assigned an initial value, it can be NULL. After a variable has been
declared it can be used throughout the current stitcher, but can only accept
values of the appropriate datatype. Some examples of variable declaration
are shown below.
The following example declares an integer variable
called router
and assigns to it an initial value of 0
.
int router = 0;
After a variable
has been created, its value can be updated at any time. It is also possible
to assign the result of an eval
statement or a calculation
to a variable.
Example
The following example declares a text variable
called router2
and assigns to it the string "upper
".
text router2 = "upper";