F$ELEMENT()

From VSI OpenVMS Wiki
Revision as of 08:40, 18 December 2018 by Darya.zelenina (talk | contribs) (Created page with "'''F$ELEMENT()''' is a lexical function that extracts one element from a string of elements. It can be used, among other things, to emulate arrays in DCL...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

F$ELEMENT() is a lexical function that extracts one element from a string of elements. It can be used, among other things, to emulate arrays in DCL.

Format

F$ELEMENT(element-number, delimiter, string)

Element numbers range from 0 to F$LENGTH(string). Delimiter is the character used to delimit the elements in the string. For example, in "JAN/MAR/APR/MAY", the delimiter is "/", and in "John Doe", the delimiter is " ". String is the string containing the element.

Example

$ DAY_LIST = "MON/TUE/WED/THU/FRI/SAT/SUN"
$ MONDAY = F$ELEMENT(0,"/",DAY_LIST)
$ SHOW SYM MONDAY
   MONDAY = "MON"
 

See also