UnicodeChar (Unicode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (syntax terms, tags, links and printtext)
Line 1: Line 1:
{{Template:Unicode:UnicodeChar subtitle}}
{{Template:Unicode:UnicodeChar subtitle}}


This function returns the string value of the single character at a specified
The <var>UnicodeChar</var> function returns the string value of the single character at a specified position in the method object <var>Unicode</var> string.
position in the method object <var>Unicode</var> string.


The <var>UnicodeChar</var> function is available as of version 7.5  of the <var class=product>Sirius Mods</var>.
==Syntax==
==Syntax==
{{Template:Unicode:UnicodeChar syntax}}
{{Template:Unicode:UnicodeChar syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%outUni</th>
<tr><th>%outUnicode</th>
<td>A <var>Unicode</var> variable to receive the result of the <var>UnicodeChar</var> method. </td></tr>
<td>A <var>Unicode</var> variable to receive the result of the <var>UnicodeChar</var> method.</td></tr>
<tr><th>unicode</th>
<tr><th>unicode</th>
<td>A <var>Unicode</var> string. </td></tr>
<td>A <var>Unicode</var> string.</td></tr>
<tr><th>position</th>
<tr><th>position</th>
<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>
<td>The position in the method object string, <var>unicode</var>, of the character you want to identify. A value of 1 finds the first character in the string.</td></tr>
</table>
</table>
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>The ''position'' value must be a non-negative, non-zero number;
<li>The <var class="term">position</var> value must be a non-negative, non-zero number; a zero or negative number results in request cancellation.
a zero or negative number results in request cancellation.
<li>A <var class="term">length</var> value greater than the declared length of the output string results in request cancellation.
A ''length'' value greater than the declared length
<li>For a given <var class="term">position</var>, the <var class="term">UnicodeChar</var> function returns the same value as the <var>[[UnicodeSubstring (Unicode function)|UnicodeSubstring]]</var> function with a length argument of <code>1</code>.
of the output string results in request cancellation.
<li>The <var>UnicodeChar</var> method is analogous to the intrinsic <var>String</var> [[Char (String function)|Char]] function.
<li>For a given position, the <var>UnicodeChar</var> function returns the same value as
<li><var>UnicodeChar</var> is available as of <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.5.
the [[UnicodeSubstring (Unicode function)|UnicodeSubstring]] function with a length argument of <tt>1</tt>.
<li>The <var>UnicodeChar</var> method is analogous to
the intrinsic <var>String</var> [[Char (String function)|Char]] function.
</ul>
</ul>
===Example===


The following request calls <var>UnicodeChar</var> two times:
==Example==
<p class="code">Begin
<ol>
printText {'inaugural':unicodeChar(5)}
<li>The following request calls <var>UnicodeChar</var> two times:
%u is unicode initial('xyz&amp;#xA1;':U
<p class="code">begin
printText {%u:unicodeChar(4)}
  [[PrintText statement|printText]] {'inaugural':unicodeChar(5)}
End
  %u is unicode initial('xyz&amp;#xA1;':U
  printText {%u:unicodeChar(4)}
end
</p>
</p>


Line 42: Line 39:
</p>
</p>


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.
</ol>


For further information about the above request, see descriptions of:
==See also==
<ul>
<ul>
<li>the [[Intrinsic classes#printtext|PrintText]] statement
<li>the instrinsic <var>String</var> [[U (String function)|U]] function
<li>the instrinsic <var>String</var> [[U (String function)|U]] function
</ul>
</ul>
==See also==
 
{{Template:Unicode:UnicodeChar footer}}
{{Template:Unicode:UnicodeChar footer}}

Revision as of 07:24, 24 February 2011

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


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

Syntax

%outUnicode = unicode:UnicodeChar( position)

Syntax terms

%outUnicode A Unicode variable to receive the result of the UnicodeChar method.
unicode A Unicode string.
position The position in the method object string, unicode, 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.
  • UnicodeChar is available as of "Sirius Mods" Version 7.5.

Example

  1. 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.

See also

  • the instrinsic String U function