FIELD - obtain token field from string.

FIELD(S1[,N,S2,S3]) returns S

returns a token field from the string S1. N is an integer indicating which token you want; for example, if N is 2, FIELD obtains the second token field. If you omit N, the default is 1.

S2 is a "skip" string: the set of characters that should be skipped before starting to a token field. By default, S2 is " *t", i.e. the blank and the horizontal tab. In this case, FIELD finds the beginning of each token field by skipping over any sequence of blanks and/or tabs following the end of the previous field. The first character that is neither a blank nor a tab is the beginning of the next token field. If S2 is null (just ""), FIELD does not skip any characters.

S3 is a "stop" string: the set of characters that may indicate the end of a token field (once FIELD has started to collect characters for the field). By default, S3 is equal to S2. Thus if S2 is ";" each field begins with the first first character after one or more semicolons and ends as soon as another semicolon is found. The stop character is NOT part of the substring that FIELD returns.

Copyright © 1996, Thinkage Ltd.