Consider just the fragment
 
&I SETA 0
&J SETA 1
&F SETC ' '
.*
.MACDAT ANOP ,
&STR SETC '&&MDAT('.'&J'.')&F.SETA '
AIF (&I EQ 0).MACD30
&STR SETC '&STR'.'&MDAT(&I),'
.MACD30 ANOP ,
&STR SETC '&STR'.'&MDAT(&I+1),&MDAT(&I+2),'
&STR SETC '&STR'.'&MDAT(&I+3),&MDAT(&I+4),'
&STR SETC '&STR'.'&MDAT(&I+5),&MDAT(&I+6),'
&STR SETC '&STR'.'&MDAT(&I+7)'
. . .

It would appear that a sequence of strings of the form
 
|&whatever(1) seta 1,2,3,4,5,6,7,8
|&whatever(9) seta 9,10,11,12,13,14,15,16
 
with the values 1, 2, 3, . . . replaced by more interesting ones is being 
formatted.
 
This  can be accomplished by
 
|&nrows seta . . .                       --an approprtiate value
|&i        seta   0                         --initialize .oloop index
|.oloop  anop  ,                          --top of outer, row loop
|&i        seta   &i+1                    --increment .oloop index
|&rows_complete setb (&i gt &nrows)  --last row string formatted?
|           aif     (&rows_complete).olend   --if so, leave .oloop
|&string setc  '&identifier.('.'&i'.')  seta '
|&delimiter setc ','                      --list-element delimiter, comma
|&rowbase seta (&i-1)*8             --0, 8, 16, . . .
|&j        seta  0                          --initialize .iloop index 
|.iloop   anop                             --top of inner, element loop
|&j        seta  &j+1                     --increment .iloop index
|&eor    setb  (&j gt 8)                --end-of-row reached?
|           aif    (&eor).ilend            --if so, leave .iloop
|&not_8 setb (&j lt 8)                  --not last concatenand in row?
|           aif    (&not_8).delimiter_set    --if so, ok
|&delim setc  ''                           --no, nul out list-element delimiter
|.delimiter_set anop
|&esub  seta  &rowbase+&j         --calculate row-element subscript 
|&string setc  '&string'.'&element(&esub)'.'&delim'     --concatenate an element
|          ago   .iloop                     --next concatenard
|.ilend  anop   ,                          --bottom of .iloop 
|          ago   .oloop                    --next row da capo
|.olend anop  ,                           --bottom of .oloop
 
 
E. B. White wrote that anyone who admired the word 'personalized' should be 
free to use it himself, but that he should not be free to teach others to do so.
  
The macro language is a powerful statement-level one that should be written 
with respect for the facilities it makes available; in particular, it should be 
written to be maintainable and readable.  DO-group surrogates should be 
explicit, subscript calculations should be explicit, etc., etc.
 
John Gilmore
                                          

Reply via email to