NotAtEnd (StringTokenizer function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 1: Line 1:
{{Template:StringTokenizer:NotAtEnd subtitle}}
{{Template:StringTokenizer:NotAtEnd subtitle}}


This method returns a Boolean value that is <code>true</var> if
This method returns a Boolean value that is <code>true</code> if
any tokens remain starting from <var>[[NextPosition (StringTokenizer property)|NextPosition]]</var>.
any tokens remain starting from <var>[[NextPosition (StringTokenizer property)|NextPosition]]</var>.


Line 10: Line 10:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%boolean</th>
<tr><th>%boolean</th>
<td>An enumeration object of type <var>Boolean</var> to contain the returned value of <var>NotAtEnd</var>.
<td>An enumeration object of type <var>Boolean</var> to contain the returned value of <var>NotAtEnd</var>. The result is <code>true</code> if any tokens remain, starting from <var>NextPosition</var>, and <code>false</code> if no tokens remain.


For more information about <var>Boolean</var> enumerations, see [[Enumerations#Using_Boolean_enumerations|"Using Boolean Enumerations"]]. </td></tr>
For more information about <var>Boolean</var> enumerations, see [[Enumerations#Using_Boolean_enumerations|"Using Boolean Enumerations"]]. </td></tr>
Line 20: Line 20:
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>The tokenizing position may be after the last token but
<li>It is illegal to scan for a token past the <var>CurrentToken</var> if <var>NotAtEnd</var> is <code>false</code>.
<li>For <var>Spaces</var> tokenization, a token remains if there are any non-<var>Spaces</var> characters remaining at or
after <var>NextPosition</var>.
<li>For <var>Separators</var> tokenization, a token remains if either:
<ul>
<li><var>NextPosition</var> is less than or equal to the length of the <var>String</var>.
<li>Either a token has not been located in the <var>String</var>, or
the last method which located a token found a separator at the end of the <var>String</var>.
</ul>
<li> <var>NextTokenPositin</var> may be after the last token but
not necessarily at the end of the token string.
not necessarily at the end of the token string.
In the following code sequence, the return from <var>NotAtEnd</var> is <var>True</var>
In the following code sequence, the return from <var>NotAtEnd</var> is <code>true</code>
and the position is not at the end of the string:
and the position is not at the end of the string:
<p class="code">%tok:string = 'example      '
<p class="code">%tok:string = 'example      '

Revision as of 20:54, 27 October 2012

Is present tokenizing position at end of tokenizerstring? (StringTokenizer class)


This method returns a Boolean value that is true if any tokens remain starting from NextPosition.

Syntax

%boolean = stringTokenizer:NotAtEnd

Syntax terms

%boolean An enumeration object of type Boolean to contain the returned value of NotAtEnd. The result is true if any tokens remain, starting from NextPosition, and false if no tokens remain. For more information about Boolean enumerations, see "Using Boolean Enumerations".
stringTokenizer A StringTokenizer object expression.

Usage notes

  • It is illegal to scan for a token past the CurrentToken if NotAtEnd is false.
  • For Spaces tokenization, a token remains if there are any non-Spaces characters remaining at or after NextPosition.
  • For Separators tokenization, a token remains if either:
    • NextPosition is less than or equal to the length of the String.
    • Either a token has not been located in the String, or the last method which located a token found a separator at the end of the String.
  • NextTokenPositin may be after the last token but not necessarily at the end of the token string. In the following code sequence, the return from NotAtEnd is true and the position is not at the end of the string:

    %tok:string = 'example ' %tok:nextPosition = 10 %tok:notAtEnd

  • AtEnd is the reverse of NotAtEnd: it returns a False value if the current tokenizing position is not at the end of the string.

See also