EasyManua.ls Logo

WILLTEK 4403 - Variable

WILLTEK 4403
484 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 6 RAPID!
Commands
170 WCDMA Options Version 6.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

Table of Contents

Other manuals for WILLTEK 4403

Related product manuals