Date: Wed, 19 Jan 2005 13:29:15 -0600
Marilyn Hilb <[EMAIL PROTECTED]> wrote:

> I frequently see this type of line K = K in the code
> I work on and never understood why.
>
> -----Original Message-----
> From: Andrea Charles [mailto:[EMAIL PROTECTED]
>
> Do you need the K = K ?
> --------------------------
> ... (Code from Charles Stevenson)
>
> REMOVE DUM FROM K SETTING MORE ; check for any delimiters
> K = K ; * reset rmv ptr in case calling pgm cares.

According to the UniData Help for REMOVE, in the code sample above, DUM
would be set to the first string delimited by a standard delimiter (e.g.,
@AM, @VM), and MORE would be set to index the level of the delimiter
encountered: 0=End of array, 1=Record Mark (255), [EMAIL PROTECTED] (254), 
[EMAIL PROTECTED] (253),
etc.  A pointer is maintained so that the next REMOVE X FROM K would return
the next string.

The comment is stating that the "K = K" is used to reset the REMOVE pointer
to the beginning of the string.

Further info on using REMOVE:

REMOVE is useful for sequentially processing all the elements of a dynamic
array without having to "recount" for each subsequent item.  However, you
need to check your delimiters to find attributes/values/subvalues.  A
similar method to process each attribute is to SELECT K TO KLIST and then
READNEXT DUM FROM KLIST within a loop.

--Tom Pellitieri
  Century Equipment
  Toledo, Ohio
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to