Gasboy CFN III Manager Manual V3.6 User Manual
Page 220
Advanced Command Files
How to Use the IF Command
Page 20-8 MDE-4871 CFN III Manager’s Manual for Windows® XP Embedded - Version 3.6 · August 2010
The variables, which are stored on the RAM disk as strings, are implemented as the contents
of the file R:CMD#.VAR, where # is a number one greater than the command processor
number. SET_VAR will create this file as a hidden file, so it will not normally be seen.
Note that when you are setting a variable with the SET_VAR command, you do not preface it
with a percent sign (%). However, when you use a variable, such as in an ECHO command
(see the example that follows this section), you do preface the variable with a percent sign.
When user variables are stored as strings, they can be used as numbers. Strings may be up to
118 characters in length.
In SET_VAR,
• M stands for configured monetary units (in the United States, the default configuration is
for two decimal places, xx.xx, for cents as hundredths of a dollar).
• Q stands for configured quantity units; the default configuration is for three decimal
places, xx.xxx, for thousandths of a unit.
• @ denotes an entry made at a terminal.
SET_VAR has the forms shown in the following chart. Note that square brackets, [ ], mean
that the contents enclosed within the pair of brackets are optional. A vertical bar, |, means or; it
separates alternatives.
SET_VAR Form
Function
set_var
Lists contents of all variables
set_var;i
Deletes all variables
set_var x = hello world
Stores hello world in %x
set_var x + 5
Adds 5 to current contents of %x
set_var x - 1
Subtracts 1 from current contents of %x
set_var x * %b
Multiplies current contents of %x by %b
set_var x / 10
Divides current contents of %x by 10
set_var x %10
Stores the remainder of %x divided by 10
in %x
set_var x ? filename
Stores the length of the designated file in
%x
set_var x # string
Stores the length of the designated string
in %x
set_var x ^ %y
Stores the exclusive-or of %x and %y in
%x
set_var x = M | Q xx.xx[x]
Stores the entered monetary (if M) or
quantity (if Q) amount (xx.xx[x]) in %x
set_var x @[M | Q] promptstring
Echoes promptstring to command
terminal, and waits for text (if @), a
monetary amount (if @M), or a quantity (if
@Q) to be entered at the terminal. That
text or amount will then be stored in
variable %x
set_var x := %y + 5
Stores the sum of %y + 5 in %x