CurrentQuoted (StringTokenizer function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Undo revision 31131 by Goff (talk))
m (get it right this time)
Line 15: Line 15:
<td>An enumeration object of type <var>Boolean</var> to contain the returned value of <var>CurrentQuoted</var>.
<td>An enumeration object of type <var>Boolean</var> to contain the returned value of <var>CurrentQuoted</var>.


For more information about <var>Boolean</var> enumerations, see [[Using Boolean enumerations]]. </td></tr>
For more information about <var>Boolean</var> enumerations, see [[Enumerations#Using_Boolean_enumerations|"Using Boolean Enumerations"]]. </td></tr>
<tr><th>stringTokenizer</th>
<tr><th>stringTokenizer</th>
<td>A <var>StringTokenizer</var> object expression.</td></tr>
<td>A <var>StringTokenizer</var> object expression.</td></tr>

Revision as of 09:13, 19 May 2011

Is current token a quoted token? (StringTokenizer class)


This method returns a Boolean value that indicates whether the current token is a quoted token. A quoted token contains all the characters between a pair of identical quotation characters.

The CurrentQuoted value is True if the current token is quoted; otherwise it is False.

Syntax

%boolean = stringTokenizer:CurrentQuoted

Syntax terms

%boolean An enumeration object of type Boolean to contain the returned value of CurrentQuoted. For more information about Boolean enumerations, see "Using Boolean Enumerations".
stringTokenizer A StringTokenizer object expression.

Usage notes

  • The Quotes characters are initially settable in the New) call that creates the tokenizer instance.
  • A quotation character may participate in only one quoted region. The first quotation character from the beginning of the tokenization string is paired with the following identical quotation character in the string. An unpaired quotation character causes a request cancellation.
  • A quoted region is not affected by the TokensToLower and TokensToUpper properties.
  • The RemoveQuotes property controls whether quotes are removed from the returned values of quoted tokens.

Examples

In the following request fragment, the selection of a quoted token is verified by a CurrentQuoted call:

%tok = new(quotes='"') %tok:string = 'simple "quoted tokens" example' PrintText {~} is {%tok:nextToken} PrintText {~} is {%tok:nextToken} PrintText {~} is {%tok:currentToken} PrintText {~} is {%tok:currentQuoted}

The result is:

%tok:nextToken is simple %tok:nextToken is quoted tokens %tok:currentToken is quoted tokens %tok:currentQuoted is True

Note: Using the PrintText statement is described in PrintText. Using PrintText to print an enumeration value is described in the first "Note" in ?? refid=crenums..

See also