AtEnd (StringTokenizer function): Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 6: | Line 6: | ||
otherwise it is <code>False</code>. | otherwise it is <code>False</code>. | ||
The tokenizing position is given by [[NextPosition (StringTokenizer property)|NextPosition]]. | The tokenizing position is given by <var>[[NextPosition (StringTokenizer property)|NextPosition]]</var>. | ||
==Syntax== | ==Syntax== | ||
{{Template:StringTokenizer:AtEnd syntax}} | {{Template:StringTokenizer:AtEnd syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
Line 15: | Line 17: | ||
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> | ||
<tr><th>stringTokenizer</th> | <tr><th>stringTokenizer</th> | ||
<td>A <var>stringTokenizer</var> object.</td></tr> | <td>A <var>stringTokenizer</var> object.</td></tr> | ||
Line 29: | Line 32: | ||
%tok:atEnd | %tok:atEnd | ||
</p> | </p> | ||
<li>[[NotAtEnd (StringTokenizer function)|NotAtEnd]] is the reverse of <var>AtEnd</var>: | <li><var>[[NotAtEnd (StringTokenizer function)|NotAtEnd]]</var> is the reverse of <var>AtEnd</var>: | ||
it returns a value of <code>False</code> | it returns a value of <code>False</code> | ||
if the current tokenizing position is at the end of the string. | if the current tokenizing position is at the end of the string. |
Revision as of 21:31, 5 July 2012
Is current tokenizing position at the end of the string? (StringTokenizer class)
This method returns a Boolean value that indicates whether
the present tokenizing position is immediately after the last token.
The value is True
if the position at after the last token;
otherwise it is False
.
The tokenizing position is given by NextPosition.
Syntax
%boolean = stringTokenizer:AtEnd
Syntax terms
%boolean | An enumeration object of type Boolean to contain the returned value of AtEnd. For more information about Boolean enumerations, see "Using Boolean Enumerations". |
---|---|
stringTokenizer | A stringTokenizer object. |
Usage notes
- The current tokenizing position may be after the last token but
not necessarily at the end of the token string.
In the following code sequence, the return from AtEnd is
True
and the position is not at the end of the string:%tok:string = 'example ' %tok:nextPosition = 10 %tok:atEnd
- NotAtEnd is the reverse of AtEnd:
it returns a value of
False
if the current tokenizing position is at the end of the string.
Examples
The following request selects the string's tokens one after another until the end of the string is detected:
begin %tok is object stringtokenizer %tok = new %tok:string = 'Content-Type: text/plain; charset="US-ASCII"' repeat while not %tok:atEnd printText {~} is {%tok:nextToken} end repeat end
The result is:
%tok:nextToken is Content-Type: %tok:nextToken is text/plain; %tok:nextToken is charset="US-ASCII"