UnicodeChar (Unicode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 32: Line 32:
of the output string results in request cancellation.
of the output string results in request cancellation.
<li>For a given position, the UnicodeChar function returns the same value as
<li>For a given position, the UnicodeChar function returns the same value as
the UnicodeSubstring function (described ??[[UnicodeSubstring (Unicode function)|UnicodeSubstring]])
the [[UnicodeSubstring (Unicode function)|UnicodeSubstring]] function with a length argument of <tt>1</tt>.
with a length argument of <tt>1</tt>.
<li>The UnicodeChar method is analogous to
<li>The UnicodeChar method is analogous to
the String intrinsic Char method (??[[Char (String function)|Char]]).
the intrinsic String [[Char (String function)|Char]] function.
</ul>
</ul>
===Example===
===Example===
Line 43: Line 42:
     Begin
     Begin
       printText {'inaugural':unicodeChar(5)}
       printText {'inaugural':unicodeChar(5)}
       %u is unicode initial('xyz&amp;#xA1;':U)
       %u is unicode initial('xyz&amp;#xA1;':[U (String function)|U]])
       printText {%u:unicodeChar(4)}
       printText {%u:unicodeChar(4)}
     End
     End
Line 56: Line 55:
The question mark in the result represents an EBCDIC character that
The question mark in the result represents an EBCDIC character that
is not displayable.
is not displayable.
The U constant function used in the example is described ??[[U (String function)|U]].
For information about the PrintText statement, see the list item [[??]] refid=intprnt..
For information about the PrintText statement, see the list item [[??]] refid=intprnt..

Revision as of 09:01, 10 December 2010

Single character at specified position of string

This function returns the string value of the single character at a specified position in the method object Unicode string.

The UnicodeChar function is available as of version 7.5 of the Sirius Mods.

Syntax

  %outUni = unicode:UnicodeChar(position)

Syntax Terms

%outUni
A Unicode variable to receive the result of the UnicodeChar method.
unicode
A Unicode string.
position
The position in the method object string of the character you want to identify. A value of 1 finds the first character in the string.

Usage Notes

  • The position value must be a non-negative, non-zero number; a zero or negative number results in request cancellation. A length value greater than the declared length of the output string results in request cancellation.
  • For a given position, the UnicodeChar function returns the same value as the UnicodeSubstring function with a length argument of 1.
  • The UnicodeChar method is analogous to the intrinsic String Char function.

Example

The following request calls UnicodeChar two times:

    Begin
      printText {'inaugural':unicodeChar(5)}
      %u is unicode initial('xyz&#xA1;':[U (String function)|U]])
      printText {%u:unicodeChar(4)}
    End

The result is:

    g
    ?

The question mark in the result represents an EBCDIC character that is not displayable. For information about the PrintText statement, see the list item ?? refid=intprnt..