UnicodeEQ, UnicodeNE, UnicodeLT, UnicodeLE, UnicodeGE and UnicodeGT (Unicode functions): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Automatically generated page update)
 
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:Unicode:UnicodeEQ subtitle}}
{{Template:Unicode:UnicodeEQ, UnicodeNE, UnicodeLT, UnicodeLE, UnicodeGE and UnicodeGT subtitle}}


This page is [[under construction]].
These Unicode comparison methods perform the named comparison operation between their <var>Unicode</var>
==Syntax==
string method objects and the method argument values. The methods are useful whenever you need to
do comparisons and ordinary EBCDIC string comparisons are not sufficient, say where you may be working
with characters that are not translatable to EBCDIC.
 
==Syntax (same for UnicodeNE, UnicodeLT, UnicodeLE, UnicodeGE, and UnicodeGT)==
{{Template:Unicode:UnicodeEQ syntax}}
{{Template:Unicode:UnicodeEQ syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%number</th><td>number</td></tr>
<tr><th>%number</th>
<td>A number that indicates the success or failure of the indicated <var class="product">User Language</var> comparison: a value of 1 is returned if the stated relation between the <var class="term">unicode</var> value and the <var class="term">comparand</var> value is true; otherwise, 0 is returned.</td></tr>
 
<tr><th>unicode</th>
<tr><th>unicode</th>
<td>Unicode</td></tr>
<td>A <var>Unicode</var> string. </td></tr>
 
<tr><th>comparand</th>
<tr><th>comparand</th>
<td>Unicode</td></tr>
<td>The <var>Unicode</var> value that is being compared to the method object, <var class="term">unicode</var>. The method name indicates the type of comparison.</td></tr>
</table>
</table>
==Usage notes==
==Usage notes==
<ul>
<li><var>Unicode</var> comparisons might be useful if you want to use ASCII/Unicode 
ordering of string values (numbers < uppercase < lowercase).
</ul>
==Examples==
==Examples==
The following comparison succeeds:
<p class="code">if %dessert:unicodeEq('Apple &amp;pi;':u) then   
  ...  </p>
However, the following comparison does not:
<p class="code">if %dessert eq 'Apple &amp;pi;':u </p> 
In this last case, <var class="product">Model 204</var> will try to convert the Unicode pi character to EBCDIC,
and that operation will fail.
==See also==
==See also==
{{Template:Unicode:UnicodeEQ footer}}
{{Template:Unicode:UnicodeEQ footer}}

Latest revision as of 17:11, 6 November 2012

Compare unicode strings (Unicode class)

[Introduced in Sirius Mods 7.9]


These Unicode comparison methods perform the named comparison operation between their Unicode string method objects and the method argument values. The methods are useful whenever you need to do comparisons and ordinary EBCDIC string comparisons are not sufficient, say where you may be working with characters that are not translatable to EBCDIC.

Syntax (same for UnicodeNE, UnicodeLT, UnicodeLE, UnicodeGE, and UnicodeGT)

%number = unicode:UnicodeEQ( comparand)

Syntax terms

%number A number that indicates the success or failure of the indicated User Language comparison: a value of 1 is returned if the stated relation between the unicode value and the comparand value is true; otherwise, 0 is returned.
unicode A Unicode string.
comparand The Unicode value that is being compared to the method object, unicode. The method name indicates the type of comparison.

Usage notes

  • Unicode comparisons might be useful if you want to use ASCII/Unicode ordering of string values (numbers < uppercase < lowercase).

Examples

The following comparison succeeds:

if %dessert:unicodeEq('Apple &pi;':u) then ...

However, the following comparison does not:

if %dessert eq 'Apple &pi;':u

In this last case, Model 204 will try to convert the Unicode pi character to EBCDIC, and that operation will fail.

See also