UnicodeChar (Unicode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 13: Line 13:
{{Template:Unicode:UnicodeChar syntax}}
{{Template:Unicode:UnicodeChar syntax}}
===Syntax terms===
===Syntax terms===
<dl>
<table class="syntaxTable">
<dt><i>%outUni</i>
<tr><th><i>%outUni</i> </th>
<dd>A Unicode variable to receive the result of the UnicodeChar method.
<td>A Unicode variable to receive the result of the UnicodeChar method. </td></tr>
<dt><i>unicode</i>
<tr><th><i>unicode</i> </th>
<dd>A Unicode string.
<td>A Unicode string. </td></tr>
<dt><i>position</i>
<tr><th><i>position</i> </th>
<dd>The position in the method object string of the character you want
<td>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.</td></tr>
to identify.
</table>
A value of 1 finds the first character in the string.
 
</dl>
==Usage notes==
==Usage notes==
<ul>
<ul>

Revision as of 04:34, 19 January 2011

The value at a specified position in the input string (Unicode class)

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

%outUnicode = 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
      printText {%u:unicodeChar(4)}
    End

The result is:

    g
    ?

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

For further information about the above request, see descriptions of:

  • the PrintText statement
  • the instrinsic String U function