FutureBasic Logo

<<    Index    >> FutureBasic 5

indexf   function

foundElement = indexf(PascalString [,startElement [,indexID]])

This function searches the index$ array specified by indexID, for a string which contains the characters specified by PascalString. The search begins at the element specified by startElement. If you omit the startElement parameter, the search begins at element zero (i.e., at the beginning of the array). If you omit the indexID parameter, index$ array #0 is searched.
The search is case-sensitive. If a match is found, indexf returns the element number of the matching element; otherwise, it returns -1. If you specify an index$ array which does not exist (because no space for it has been allocated using the clear <index> statement), indexf returns -1.

elementNumber = indexf("Modem")
This code would find a match with the following index$ elements:
"my Modem"

The code would not find a match with these elements:
"horse feathers"

See Also:
CFIndexSort; clear <index>; index$ D; index$ I; index$ function; index$ statement; mem