
5238-E P-274
SECTION 12 USER TASK
•
When new data is assigned to a local variable already registered with other data, that old data is
updated.
Main program
LE33013R0301400120001
•
Up to 127 local variables can be used.
•
When a subprogram call command (CALL statement) is programmed in a main program and
subprogram with local variables set in the block containing the CALL statement, the variables
assigned numeric values in such a block are all registered as new local variables and their
numeric values are stored in memory.
Even when a local variable has the same name as one already registered before the call
statement was programmed, it is registered as a new variable.
LE33013R0301400120002
As shown above, the variables with the same name as ones already registered are registered
anew as different variables.
N0010
:
:
:
N0049
N0050
:
:
:
DIA1 = 160
DIA1 = 20
In N0010, numerical data "160" is assigned to local variable
name "DIA1", and this data remains effective up to sequence
N0049. In N0050, the new numerical data "200" is assigned
to the same local variable name "DlA1". This clears the old
data "160" and replaces it with the new data "200"
Main program
Registering local
variable in memory
Subprogram
N100 CALL O1000 ABC = 100
&DEF = 150
N1050 CALL O2000 ABC = 500
&DEF = 750
O1000
ABC
DEF
100
150
ABC
DEF
500
750
Numerical data assigned to
the local variables by the CALL
statement in the main program
Numerical data assigned to
the local variables by the CALL
statement in the subprogram