NextChar (StringTokenizer function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision: CharacterMap, RandomNumberGenerator, StringTokenizer methods)
mNo edit summary
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>Value of character at current tokenizing position</b></span>
<span style="font-size:120%; color:black"><b>Value of character at current tokenizing position</b></span>
[[Category:StringTokenizer methods|NextChar function]]
[[Category:StringTokenizer methods|NextChar function]]
[[Category:System methods]]
<!--DPL?? Category:StringTokenizer methods|NextChar function: Value of character at current tokenizing position-->
<!--DPL?? Category:StringTokenizer methods|NextChar function: Value of character at current tokenizing position-->
<!--DPL?? Category:System methods|NextChar (StringTokenizer function): Value of character at current tokenizing position-->
<!--DPL?? Category:System methods|NextChar (StringTokenizer function): Value of character at current tokenizing position-->

Revision as of 19:52, 31 December 2010

Value of character at current tokenizing position

NextChar is a member of the StringTokenizer class.

This method returns the value of the character that is at the tokenizing position, and it advances the tokenizing position past that character to the next character. The tokenizing position is the value returned by NextPosition.

Syntax

  %string = %tok:NextChar

Syntax terms

%string
A string variable to receive the returned character value.
%tok
A StringTokenizer object variable.

Usage Notes

  • If the value of AtEnd is True, issuing NextChar is invalid and cancels the request.
  • Once NextChar executes, the number of the resulting position can be returned by NextPosition.
  • The PeekChar function also returns the value of the next character, but it does not advance the tokenizing position.

Examples

The following sequence of printText statements display, respectively, E, x, a, and a, showing that the tokenizing position moves after NextChar completes but not after PeekChar completes:

    %tok:string = 'Example of peekChar'
    Print %tok:nextChar
    Print %tok:nextChar
    Print %tok:peekChar
    Print %tok:peekChar