Chapter 7
RAPID!
RAPID! syntax
270
4460 GSM System Option and 4468 EDGE System Option
Version 12.20
Variables
Variables are used to save data for later use. There are two types of variables:
numeric variables and string variables.
–
Numeric variables
contain numbers only (0...9) and are saved in the so-
called double (floating point) format on the 4400.
This is an eight-byte value with a range from –1.79769313486232E308 to
-4.94065645841247E–324 for negative values and from
4.94065645841247E–324 to 1.79769313486232E308 for positive values.
–
String variables
may contain any combination of numbers (0...9) and letters
(A...Z). Their name always must end with the ‘$’ symbol.
The length of a string variable (i.e. the number of characters) may range
from 0 to 65,535 characters.
Variables in the RAPID! environment are always local. This means that a variable
is only valid within its own RAPID! program.
When you chain programs, a local variable is not available to the program
chained. If a variable shall be global (i.e. it is available to all chained programs),
simply specify it as global.
The main commands dealing with variables are DIM, GLOBAL, VARIABLE and
ERASE.
Arrays
– All RAPID! variables can make up arrays of up to two dimensions. The index
value per dimension may range from –32,765 to +32,765.
Syntax
A variable name is not limited in length, but only the first 20 characters are
significant. A variable name has the following syntax:
–
A...Z | _{0...9 | A...Z | _} [( index1 [, index2] )]
for
numeric variables and
–
A...Z | _{ 0...9 | A...Z | _}$ [( index1 [, index2] )]
for string variables.
Notes
– The first character of a variable name has to be a letter.
– Uppercase and lowercase letters have the same meaning with RAPID!.
– A...Z are uppercase or lowercase letters.
– 0...9 are numbers between 0 and 9.
–
index1
and
index2
are integer values, making up an array.
The range of an integer value is from –32,765 to +32,765.
Examples
–
1_stValue
is not a valid variable name as it starts with a number.
–
myvar_1
,
MyVar_1
or
MYVAR_1
will be understood by RAPID! as being
the same variable.
NOTE
An array is similar to a table or a spreadsheet.