remove statement

The remove statement retrieves a substring delimited by a system delimiter from a dynamic array.

Syntax

remove var from dyn.array at position.var setting delimiter.var

Description

Before the initial call, position.var must be set to zero. The variable is updated with the end of the current substring at the end of every call.

delimiter.var is updated with the code indicating the delimiter found at the end of the substring returned. The code is one of these:

0 End of string.
2 Attribute mark (ASCII char(254)).
3 Value mark (ASCII char(253)).
4 Subvalue mark (ASCII char(252)).
5 ASCII char(251).
6 ASCII char(250).
Note: This statement requires the setting of extended compiler options.

Example(s)

$options ga
x = "a":@am:"b":@vm:"c"
l = 0
remove xx from x at l setting d
print xx,l,d
remove xx from x at l setting d
print xx,l,d
remove xx from x at l setting d
print xx,l,d

This prints:

a   2   2
b   4   3
c   6   0