
SEARCH COMMANDS
FindFirst(sourceString,findString) - where sourceString is the string to search in and findString is
the string to look for. Returns an integer character position in sourceString of the first occurence
of findString or 0 if the string was not found or if there was an error
Finds the first occurrence of findString in sourceString and returns the character position of its
first character in sourceString. Not affected by SetPosition. Always searches from character 1 of
sourceString. After FindFirst the current position is the return value of FindFirst.
Example:
put findFirst("abcdefg","c")
-- 3
FindNext(sourceString,findString) - where sourceString is the string to search in and findString is
the string to look for. Returns and integer character position in sourceString of the occurence of
findString on or after the current search position or 0 if the string was not found or if there was an
error.
Finds the first occurrence of findString in sourceString after the current position and returns the
character position of its first character in sourceString. Current position may have been set by a
previous Find or Replace or by the SetPosition command. After FindNext the current position is
the return value of FindNext. If there is no occurence after the current position, FindNext returns
0, which sets the current positon to 0, therefore causing any subsequent FindNext to start at the
beginning again.
Example:
set source = "When you select a category, the filters in that category appear in a list."
put FindFirst(source,"category")
-- 19
put FindNext(source,"category")
-- 49
setPosition(40)
Online Help
25
Kommentare zu diesen Handbüchern