NotAtEnd (StringTokenizer function): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (link repair) |
||
(7 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Template:StringTokenizer:NotAtEnd subtitle}} | {{Template:StringTokenizer:NotAtEnd subtitle}} | ||
This method returns a Boolean value that | This method returns a <var>[[Boolean enumeration]]</var> value that is <code>true</code> if | ||
any tokens remain starting from <var>[[NextPosition (StringTokenizer property)|NextPosition]]</var>. | |||
==Syntax== | ==Syntax== | ||
{{Template:StringTokenizer:NotAtEnd syntax}} | {{Template:StringTokenizer:NotAtEnd syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<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. | ||
<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> | ||
Line 21: | Line 18: | ||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul> | ||
<li> | <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 (StringTokenizer property)|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 (StringTokenizer property)|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>NextPosition</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 < | In the following code sequence, the return from <var>NotAtEnd</var> is <code>false</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 | <p class="code">%tok = 'example ':stringTokenizer | ||
%tok:nextPosition = | %tok:nextPosition = 8 | ||
%tok:notAtEnd | [[Targeted Text statements#AuditText, PrintText, and TraceText|printText]] {~=%tok:notAtEnd} | ||
</p> | </p> | ||
<li>[[AtEnd (StringTokenizer function)|AtEnd]] is the reverse of <var>NotAtEnd</var>: | |||
it returns a | <li><var>[[AtEnd (StringTokenizer function)|AtEnd]]</var> is the reverse of <var>NotAtEnd</var>: | ||
if the current tokenizing position is not at the end of the string. | it returns a <code>false</code> value if the current tokenizing position is not at the end of the string. | ||
</ul> | </ul> | ||
==See also== | ==See also== | ||
{{Template:StringTokenizer:NotAtEnd footer}} | {{Template:StringTokenizer:NotAtEnd footer}} |
Latest revision as of 21:22, 17 December 2014
Is present tokenizing position at end of tokenizerstring? (StringTokenizer class)
This method returns a Boolean enumeration 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.
|
---|---|
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.
- NextPosition 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
false
and the position is not at the end of the string:%tok = 'example ':stringTokenizer %tok:nextPosition = 8 printText {~=%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.