
6.MACRO EXECUTOR FUNCTION B-63943EN-2/01
- 226 -
Each process code consists of three digits and specifies the type of
processing to be performed. Leading zeros are omissible.
A difference between P2 and P3 and between P102 and P103 is
whether a transfer progresses from a small variable number to a large
or from a large to a small.
Example
If #8512 = 10000 and #8514 = 10010,
G315 P2 K3; is equivalent to the following steps:
#10010 = #10000
#10011 = #10001
#10012 = #10002, and
G315 P3 K3; is equivalent to the following steps:
#10012 = #10002
#10011 = #10001
#10010 = #10000
Array-type referencing of P-CODE variables
P-CODE variables (10000 and above) can be referenced as two-
dimensional or three-dimensional array-type variables. Previously
assigning proper values to the following array control variables
enables variable numbers #1 to #99 to be used to reference the P-
CODE variables for the corresponding array elements.
Array control variables
#8512: Two-dimensional array number
#8513: Three-dimensional array number
#8516: Number of one-dimensional array elements
#8517: Number of two-dimensional array elements
#8518: 1
#8519: Array start variable number
Variables #1 to #99 are used to reference the P-CODE variables by
previously specifying array types using array control variables #8516
to #8519, then specifying the target array numbers using #8512 and
#8513.
The P-CODE variables are associated with the array elements as
shown below.
P-CODE variable number
= #8519 + ((#8516*#8517)*(#8513 - 1))
+ (#8516*(#8512 -1)) + (specified variable number - 1)
Example
If #8516 = 10, #8517 = 5, and #8519 = 10100,
(1) #1 with #8512 = 1 and #8513 = 1 specified
corresponds to #10100.
(2) #10 with #8512 = 3 and #8513 = 2 specified
corresponds to #10179.