CurrentQuoted (StringTokenizer function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Is current token a quoted token?</b></span>
{{Template:StringTokenizer:CurrentQuoted subtitle}}
[[Category:StringTokenizer methods|CurrentQuoted function]]
<!--DPL?? Category:StringTokenizer methods|CurrentQuoted function: Is current token a quoted token?-->
<!--DPL?? Category:System methods|CurrentQuoted (StringTokenizer function): Is current token a quoted token?-->
<p>
CurrentQuoted is a member of the [[StringTokenizer class]].
</p>


This method returns a Boolean value that indicates whether
This method returns a Boolean value that indicates whether
Line 14: Line 8:
The CurrentQuoted value is <tt>True</tt> if the current token is quoted;
The CurrentQuoted value is <tt>True</tt> if the current token is quoted;
otherwise it is <tt>False</tt>.
otherwise it is <tt>False</tt>.
===Syntax===
==Syntax==
  %bool = %tok:CurrentQuoted
{{Template:StringTokenizer:CurrentQuoted syntax}}
===Syntax terms===
===Syntax terms===
<dl>
<dl>
Line 27: Line 21:


</dl>
</dl>
===Usage Notes===
==Usage notes==
<ul>
<ul>
<li>The Quotes characters are initially settable in the [[New (StringTokenizer constructor)|New]]) call that creates the tokenizer instance.
<li>The Quotes characters are initially settable in the [[New (StringTokenizer constructor)|New]]) call that creates the tokenizer instance.
Line 40: Line 34:
</ul>
</ul>


===Examples===
==Examples==


In the following request fragment, the selection of a quoted token
In the following request fragment, the selection of a quoted token
Line 62: Line 56:
'''Note:'''
'''Note:'''
Using the PrintText statement is described in [[Targeted Text statements|PrintText]].
Using the PrintText statement is described in [[Targeted Text statements|PrintText]].
Using PrintText to print an enumeration value is described in the first &ldquo;Note&rdquo;
Using PrintText to print an enumeration value is described in the first "Note"
in [[??]] refid=crenums..
in [[??]] refid=crenums..
==See also==
{{Template:StringTokenizer:CurrentQuoted footer}}

Revision as of 19:54, 6 February 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

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

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