Monarch 9460 Printer User Manual


 
Command Reference 5-21
Example 2
This example shows the use of local variables. The function ADDNUM has two
local variables defined that receive the parameters passed from the call. The first
parameter (#5) is placed in the TfirstNum field and the second parameter (#6) is
placed in the TsecondNum field. The TSum variable is defined as a global
Temporary variable and is accessible from any functions in the script.
DEFINE TEMPORARY, TSum, 10, N
FUNCTION START
BEGIN
.
.
.
CALL ADDNUM (#5, #6)
.
.
.
END
FUNCTION ADDNUM
BEGIN
DEFINE LOCAL,TfirstNum, 10, N
DEFINE LOCAL, TsecondNum, 10, N
ADD TfirstNum, TsecondNum
MOVE TsecondNum, Tsum
END
See Also RETURN