Chapter 7
RAPID!
Commands
286
4460 GSM System Option and 4468 EDGE System Option
Version 12.20
VARIABLE
Description
SUB ... END SUB
declare a procedure.
Procedures are commonly used to e.g. perform certain
operations that have to be carried out several times dur-
ing the program run.
After a procedure has been declared, it may be called by
[CALL] subName
.
A call of a procedure must contain all parameters in the
same order as specified in the procedure’s declaration.
A procedure may call itself recursively.
All variables used in a procedure are local unless declared
as
GLOBAL
(please see above for details).
All parameters are treated as local.
Using the
EXIT SUB
command, you may leave any pro-
cedure at any place or condition (e.g. in case a value
exceeds a certain limit, the procedure exits and passes on
control to an error handling system).
Example
The following example defines a procedure that writes
the current contents of all variables into a file with a
given file name:
SUB VarsToFile(fileName$)
LET ff = FREEFILE
OPEN fileName$ FOR OUTPUT AS #ff
VARIABLE #ff
CLOSE #ff
END SUB
Syntax
VARIABLE [ #fileNo]
Parameters
fileNo
is a handler of an open file.
Description
Outputs the contents of all currently used variables on-
screen.
The currently used variables are all variables that were
defined or used before the
VARIABLE
command
appeared in the program run.
In case you specify the optional file handler (
#fileNo
),
the output will be sent to a file.
Note:
During program development, it is sometimes quite
useful to know the contents of all variables. The
VARI-
ABLE
command also is a good tool to unmask misspell-
ings with variable names.
Example
The following example program writes the contents of all
variables to a file called ‘VAR.TXT’.
OPEN "VAR.TXT" FOR OUTPUT AS #1
VARIABLE #1
CLOSE #1
Содержание 4400 Mobile Phone Tester Series
Страница 2: ......
Страница 4: ...ii 4460 GSM System Option and 4468 EDGE System Option Version 12 20 ...
Страница 16: ...Table of Contents xiv 4460 GSM System Option and 4468 EDGE System Option Version 12 20 ...
Страница 24: ...Safety Notes Shutdown when defective xxii 4460 GSM System Option and 4468 EDGE System Option Version 12 20 ...
Страница 64: ...Chapter 1 Overview Accessories and options 40 4460 GSM System Option and 4468 EDGE System Option Version 12 20 ...
Страница 272: ...Chapter 6 Tools Audio measurements 248 4460 GSM System Option and 4468 EDGE System Option Version 12 20 ...