
6.MACRO EXECUTOR FUNCTION B-63943EN-2/01
- 270 -
Combining with array-type references
Combining this function with array-type references makes it easy to
reference the data table.
Example
If the previous sample program is combined with array-type references:
#8513=1 ;
#8516=10 ; *1)
#8517=1 ;
#8518=1 ; *2)
#8519=20000 ; *3)
#8650=20000 ;
#8651=10 ;
#8652=400 ;
#8653=10.5 ;
#8654=11.5 ;
G400 ;
IF[#8655 LT 0] GOTO 999 ;..... Go to the remaining search processing
#8512=#8655 + 1 ; *4)
:
The data table elements of a set that was retrieved can be referenced using
#1 to #99 provided that #8512, #8518, and #8519 will not be changed.
#8519=#8650 ; *5)
G400 ;
IF [#8655 LT 0] GOTO 999 ;.... Go to the remaining search processing
#8512=#8655 + 1 ;
NOTE
*1) Specifies the number of elements of a data table set (number of control
variables). The array-type references that can be used are only #1 to #99;
so the maximum allowable number of elements is 99.
*2) Before starting to make array-type references, set #8518 = 1. #1 to #99
function as array-type reference variables while #8518 = 1.
*3) Sets the start macro variable number of an array.
*4) Sets an array number (set number + 1) to be used for array-type references.
This associates #1 to #99 as follows:
#1: = #[0 + [#8519 + [#8512 -1] * #8516]]
#2: = #[1 + [#8519 + [#8512 -1] * #8516]]
#3: = #[2 + [#8519 + [#8512 -1] * #8516]]
As many definitions as the number of elements set in #8516 follow.
*5) To continue the second or subsequent searches, just change the start
macro variable number of the array; array-type references can be continued
accordingly.