UnicodeReplace (Unicode function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "<span style="font-size:120%; color:black"><b>String after replacements from Unicode replacement table</b></span> UnicodeReplace function [[...")
 
mNo edit summary
 
(31 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<span style="font-size:120%; color:black"><b>String after replacements from Unicode replacement table</b></span>
{{Template:Unicode:UnicodeReplace subtitle}}
[[Category:Intrinsic Unicode methods|UnicodeReplace function]]
<var>UnicodeReplace</var> lets you examine a given Unicode string for any replacement characters that may be in effect at your site.
[[Category:Intrinsic methods]]
<p>The <var class=product">Sirius Mods</var> Unicode tables specify translations between EBCDIC and Unicode/ASCII.  The [[Unicode#UNICODE command|UNICODE command]] lets your site create customizations (one or many replacements) of those translations, as described for the <var>[[Unicode#unicrep|Rep]]</var> subcommand of the <var>UNICODE</var> command.</p>  
[[Category:System methods]]
<!--DPL?? Category:Intrinsic Unicode methods|UnicodeReplace function: String after replacements from Unicode replacement table-->
==Syntax==
<!--DPL?? Category:Intrinsic methods|UnicodeReplace (Unicode function): String after replacements from Unicode replacement table-->
{{Template:Unicode:UnicodeReplace syntax}}
<!--DPL?? Category:System methods|UnicodeReplace (Unicode function): String after replacements from Unicode replacement table-->


Items in the replacement table are created with <tt>UNICODE Rep</tt> update
===Syntax terms===
commands, as described in [[??]] refid=updtuni..
<table class="syntaxTable">
<tr><th>%outUnicode</th>
<td>A <var>Unicode</var> variable to receive the method object string altered by any replacement characters. </td></tr>


The UnicodeReplace function is available as of version 7.3 of the ''Sirius Mods''.
<tr><th>unicode</th>
===Syntax===
<td>A <var>Unicode</var> string.</td></tr>
  %unicode = unicode:UnicodeReplace
</table>
====Syntax Terms====
<dl>
==Usage notes==
<dt><i>%unicode</i>
<ul><li>The method output is the input <var>Unicode</var> string, with those characters specified in the Unicode replacement table replaced by their corresponding <var>Unicode</var> strings. If no Unicode replacement table is in effect, the method merely copies its input.
<dd>A Unicode variable to receive the method object string altered by any
<li><var>UnicodeReplace</var> is available as of <var class="product">Sirius Mods</var> Version 7.3.
replacement characters.
<dt><i>unicode</i>
<dd>A Unicode string.
 
</dl>
===Usage Notes===
<ul>
<li>The method output is the input Unicode string, with those characters
specified in the Unicode replacement table
replaced by their corresponding Unicode strings.
If no Unicode replacement table is in effect,
the method merely copies its input.
</ul>
</ul>
===Examples===
 
==Examples==
The following example shows a successful call of UnicodeReplace.
In actual usage, updating UNICODE commands should only be issued from your <var class="product">Model 204</var> initialization stream. For the sake of this example, assume that the following had been included:
The <tt>U</tt> constant function used in the example is described
<p class="code">UNICODE Table Standard Rep U=2122 '(TM)'</p>
??[[U (String function)|U]].
accordingly, a subsequent <var>UnicodeReplace</var> example:
 
<p class="code">begin
An updating UNICODE command is used &ldquo;in-line&rdquo;
  %u Unicode Initial('Cool&amp;#x2122;':[[U (String function)|U]])
with the User Language request to make the example concrete.
  print %u:UnicodeReplace
In actual usage, updating UNICODE commands should only be issued
end
from your ''Model 204'' initialization stream.
</p>
<pre>
would result is:
    UNICODE Table Standard Rep U=2122 '(TM)'
<p class="output">Cool(TM)
    Begin
</p>
    %u Unicode Initial('Cool&amp;#x2122;':U)
    Print %u:UnicodeReplace
==See also==
    End
{{Template:Unicode:UnicodeReplace footer}}
</pre>
The result is:
<pre>
    Cool(TM)
</pre>

Latest revision as of 17:32, 6 November 2012

Apply the replacement table to this string (Unicode class)

UnicodeReplace lets you examine a given Unicode string for any replacement characters that may be in effect at your site.

The Sirius Mods Unicode tables specify translations between EBCDIC and Unicode/ASCII. The UNICODE command lets your site create customizations (one or many replacements) of those translations, as described for the Rep subcommand of the UNICODE command.

Syntax

%outUnicode = unicode:UnicodeReplace

Syntax terms

%outUnicode A Unicode variable to receive the method object string altered by any replacement characters.
unicode A Unicode string.

Usage notes

  • The method output is the input Unicode string, with those characters specified in the Unicode replacement table replaced by their corresponding Unicode strings. If no Unicode replacement table is in effect, the method merely copies its input.
  • UnicodeReplace is available as of Sirius Mods Version 7.3.

Examples

In actual usage, updating UNICODE commands should only be issued from your Model 204 initialization stream. For the sake of this example, assume that the following had been included:

UNICODE Table Standard Rep U=2122 '(TM)'

accordingly, a subsequent UnicodeReplace example:

begin %u Unicode Initial('Cool&#x2122;':U) print %u:UnicodeReplace end

would result is:

Cool(TM)

See also