TokensToLower (StringTokenizer property)

From m204wiki
Revision as of 19:55, 16 December 2010 by 198.242.244.36 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Convert returned tokens to all-lowercase?

TokensToLower is a member of the StringTokenizer class.

This readWrite property returns or sets the Boolean value that indicates whether to convert returned, non-quoted, tokens to all-lowercase characters. The default value for a new tokenizer is False.

Syntax

  %bool = %tok:TokensToLower
  %tok:TokensToLower = %bool

Syntax terms

%bool
An enumeration object of type Boolean to contain the returned value of TokensToLower. For more information about Boolean enumerations, see Using Boolean enumerations.
%tok
A StringTokenizer object variable.

Usage Notes

  • TokensToLower has no effect on non-alphabetic characters.
  • The TokensToUpper property specifies or reports whether returned tokens are to be converted to uppercase characters.

Examples

In the following example, the input string's tokens are returned in sequence under the default (False) setting of TokensToLower:

    %tok is object stringtokenizer
    %tok = new
    %tok:string = 'Bad,F  ?3mO ,7,{x Z}'
    repeat while not %tok:atEnd
       printText {~} is {%tok:nextToken}
    end repeat

The resulting tokens are:

    %tok:nextToken is Bad,F
    %tok:nextToken is ?3mO
    %tok:nextToken is ,7,{x
    %tok:nextToken is Z}

If %tok:TokensToLower = True is specified for the instantiated object, the resulting tokens are:

    %tok:nextToken is bad,f
    %tok:nextToken is ?3mo
    %tok:nextToken is ,7,{x
    %tok:nextToken is z}