Lexical operator for extracting elements from a list of elements. Format %ELEMENT (integer,string1,string2)
1 – Arguments
integer The first argument, of type integer, is the element number to extract. The first element is number 0. string1 The second argument, of type string, is the delimiter or delimiters that separate elements. string2 The third argument, of type string, is the list of elements.
2 – Description
%ELEMENT is modeled after the OpenVMS DCL lexical function F$ELEMENT. It is used to extract one element from a string of elements. Note that unlike F$ELEMENT, you may specify multiple delimiters. The result is the specified string element. If the specified element number is greater than the number of elements in the list, the delimiter argument is returned.
3 – Example
.PRINT "%ELEMENT (2, <+-*/>, JOE+FRED-TOM*BILL/ERIC)" After lexical processing, the statement appears as: .PRINT "TOM"