Equinox Online Help - Language Reference - A to Z
Search / SearchNext |
|
---|---|
Applies to | |
Syntax | Search StringExpression, PatternExpression, StartItem, LengthItem [, SearchExpression, NoSlidingSearchExpression] SearchNext StringExpression, PatternExpression, StartItem, LengthItem [, SearchExpression, NoSlidingSearchExpression] |
Action | [Statement] Searches for a string within a string. |
Scope | Usable anywhere. |
Notes | This statement searches for the string PatternExpression, inside StringExpression. The SearchNext statement uses the start parameter returned by a previous Search statement as the place to start searching from. You can include the following special characters in PatternExpression:
The fifth argument, SearchExpression, can take one of the following values:
If you omit SearchExpression, then by default the value 0 is used. Exact case dictates the two strings must be the same case to match. Any case ignores the case differences. Special characters sometimes occur in the target, for example back-slash occurs in operating system file paths. You can choose to ignore special characters in the PatternExpression, and treat them as literal characters. Sliding search means, for example, that searching for “asdf” in “this asdf string” returns true (This example uses value 6). All searches are sliding searches by default. If NoSlidingSearchExpression is supplied and is nonzero, the search only succeeds if the whole of the string is matched. If PatternExpression is not matched, SysError is set to 1. Otherwise it is set to zero, the position of its first character is returned in StartItem, and the length of the matching portion of StringExpression is returned in LengthItem (if it is included). This is useful if you include wildcard characters in PatternExpression. |
Category | String handling |
See Also | ChrList, Chrs, Compare, Fill, IsNumber, Left_Function, Len, Match, Maxlen, Mid_Function, Remove, Replace, Right_Function], SetLen, SetMaxLen, SortOrder, SubstituteData |
Example | This example finds each occurrence of the letter h in the string, starting from the end. int st, ln |