StringScanner.SkipOverToken Function
Syntax
Chars_Skipped as N = SkipOverToken as n(kind as c)
Arguments
- Chars_Skipped
The number of characters the offset has been moved.
- kind
The type of token to skip over. 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 over a sequence of tokens . (I-identier,F-function,S-string,D-date,N-number,L-logical,U-unary operator,B-binary,A-array operator or '*' for all), Returns number of characters skipped.
Discussion
The <StringScanner>.SkipOverToken() function moves the offset to the next token of the specified type, and returns the characters moved.
Example
dim scanner as P
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("L")
= .T.
? scanner.getremainder()
= .F.) .or. ( date()= {10/10/2005}
complex[1].subelement[1].property
? scanner.SkipOverToken("L")
= 3
? scanner.getremainder()
= ) .or. ( date()= {10/10/2005}
complex[1].subelement[1].propertySee Also