Xbasic

POS_FROM_WORD_NUMBER Function

Syntax

Position as N = pos_from_word_number(C string ,N word_number [,C separator ])

Arguments

string

A list of entries.

word_number

The number of an entry in the list.

separator

The separator between entries. The default is CR-LF. Optional

Description

Returns the starting character position of word_number in string.

Discussion

POS_FROM_WORD_NUMBER() returns the position of the first character of the entry specified by Entry_Number in the Search_List. Position - 1 is a count of characters before the requested entry in the list. This count includes separator characters. The function returns a 0 if the Entry_Number is negative or zero.

Example

pos_from_word_number(cstates() , 3, crlf() ) -> 18
dim cs as C
cs = "abc:def:ghi;jkl"
pos_from_word_number(cs,3,":") -> 9

See Also