UnicodeChar (Unicode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Created page with "This intrinsic function returns the string value of the single character at a specified position in the method object Unicode string. The UnicodeChar func...")
 
Line 5: Line 5:
===UnicodeChar syntax===
===UnicodeChar syntax===
   %outUni = unicode:UnicodeChar(position)
   %outUni = unicode:UnicodeChar(position)
'''Syntax Terms'''
====Syntax Terms====
<dl>
<dl>
<dt>%outUni
<dt>%outUni
Line 17: Line 17:
   
   
</dl>
</dl>
===Usage Notes===
===Usage Notes===
*The ''position'' value must be a non-negative, non-zero number; a zero or negative number results in request cancellation.
*The ''position'' value must be a non-negative, non-zero number; a zero or negative number results in request cancellation.

Revision as of 17:30, 20 October 2010

This intrinsic 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.

UnicodeChar 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.
  • For a given position, the UnicodeChar function returns the same value as UnicodeSubstring with a length argument of '1'.
  • The UnicodeChar method is analogous to the Char function

Examples

The following request calls UnicodeChar two times:

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

The result is:

   g
   ?

The question mark in the result represents an EBCDIC character that is not displayable.