StringScanner.SkipToToken Function
Syntax
Result_Flag as L = SkipToToken as l(kind as c)
Arguments
- Result_Flag
True indicates that the token of the specified type was found.
- kind
The type of token to find. The allowed types are:
- "I" = identier
- "F" = function
- "S" = string
- "D" = date
- "N" = number
- "L" = logical
- "U" = unary operator
- "B" = binary
- "A" = array operator
- "*" = all
Description
Skip until a token is encountered. kind is combination of (I-identier,F-function,S-string,D-date,N-number,L-logical,U-unary operator,B-binary,A-array operator or '*' for all) Return true if successful.
Discussion
The <StringScanner>.SkipToToken() function moves the offset to the beginning of the found token.
Example
dim t as C
t = <<%txt%
result[1] = foo( x + y , "Some text" ) .or. (lookfor = .F.) .or. ( date()= {10/10/2005}
complex[1].subelement[1].property
%txt%
scanner = stringscanner.create(t)
? scanner.SkipToToken("P")
= .T.
? scanner.GetToOffset()
= result[1] = foo( x + y , "Some text" ) .or. (lookfor = .F.) .or. ( date()= {10/10/2005}
complex[1].subelement[1]
? scanner.GetRemainder()
= .property
? scanner.GetLineText()
= "complex[1].subelement[1].property"See Also