John Jenkins wrote on Fri, 15 Apr 2005 16:24:39 +0100

> If you want to optimise sequential processing of a
> dynamic array then use the REMOVE statement.  Much
> neglected..... HUGELY efficient

True, although one must be carefule with the REMOVE statement when you have
multi-valued attributes.  REMOVE (at least in UniData) returns up to the
next delimiter (i.e., attribute/field mark, value mark, sub-value mark,
text mark, etc.).

You can get around this by selecting your dynamic array to a list variable
and READNEXT from it.  On our system, our order header records contain a
multi-valued line index in one attribue.  I use the RAISE function to get
to the line records, as follows:

READ HEAD.REC FROM F.HEADER,HEADER.ID THEN
   LINE.IDS = RAISE(HEAD.REC<1>)
   SELECT LINE.IDS TO LID.LIST
   LOOP WHILE READNEXT LINE.ID FROM LID.LIST DO
      READ LINE.REC FROM F.LINES,LINE.ID THEN
         process LINE.REC
      END
   REPEAT
END

Just another way to speed up processing...

--Tom Pellitieri
-------
u2-users mailing list
[email protected]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to