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

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
{{Template:Unicode:UnicodeEQ, UnicodeNE, UnicodeLT, UnicodeLE, UnicodeGE and UnicodeGT subtitle}}
{{Template:Unicode:UnicodeEQ, UnicodeNE, UnicodeLT, UnicodeLE, UnicodeGE and UnicodeGT subtitle}}


These Unicode comparison methods are useful whenever you need to  
These Unicode comparison methods perform the named comparison operation between their Unicode
do Unicode comparisons and not EBCDIC or ASCII.
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==
==Syntax==
Line 17: Line 19:


==Usage notes==
==Usage notes==
<ul>
<li>Unicode 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 class="code">if %dessert:unicodeEq('Apple &amp;pi;':u) then     
   ...  </p>
   ...  </p>
However, the following comparison does not:
<p class="code">if %dessert eq 'Apple &amp;pi;':u </p> 
<var class="product">Model 204</var> will try to convert Unicode pi to EBCDIC,
and that operation will fail.


==See also==
==See also==
{{Template:Unicode:UnicodeEQ footer}}
{{Template:Unicode:UnicodeEQ footer}}

Revision as of 21:00, 30 March 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

%number = unicode:UnicodeEQ( comparand)

Syntax terms

%numbernumber
unicode A Unicode string.
comparand Unicode

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

Model 204 will try to convert Unicode pi to EBCDIC, and that operation will fail.

See also