Chapter 7
RAPID!
Commands
4460 GSM System Option and 4468 EDGE System Option
Version 12.20
283
Commands related to
variables, procedures and
functions
The following commands concern the declaration, output and deletion of vari-
ables and the usage of procedures and functions:
DIM
ERASE
Command
Short description
DIM
Declares local variables.
ERASE
Releases allocated memory of a variable.
FUNCTION
Declares a function.
GLOBAL
Declares global variables.
SUB
Declares a procedure (subroutine).
VARIABLE
Prints variable contents to screen or file.
Syntax
DIM varName [{, varName}]
Parameters
varName
is a valid variable name.
Description
Declares a local variable. The variable is only accessible
to the program element it has been declared in. This
means, a local variable declared in a function is not
accessible by the main program and vice versa.
Variables that are accessible for all program elements are
called ‘global’ (please see below for more details).
Note:
There is no need to declare local variables. Within
the RAPID! environment, all variables are interpreted as
local by definition.
However, after a variable has been declared using the
DIM
command, all subsequent variables have to be
declared with
DIM
as well.
In order to keep programs easily maintainable and to
avoid errors due to misspelled variable names, we
strongly recommend to declare variables in larger pro-
grams.
Example
DIM Days$(7), Months$(12)
declares two string
arrays.
Syntax
ERASE varName [ {, varName} ]
Parameters
varName
is a valid variable name.