Difference between revisions of "STRCMP()"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) |
Yvonnemilne (Talk | contribs) |
||
Line 1: | Line 1: | ||
− | |||
− | |||
==Class== | ==Class== | ||
− | + | Expressions And Type Conversion | |
==Purpose== | ==Purpose== | ||
− | + | Function to compare two strings | |
==Syntax== | ==Syntax== | ||
− | + | STRCMP(<expC1>,<expC2>) | |
==See Also== | ==See Also== | ||
− | + | [[AT()]], [[CHROVERLAP()]], [[GETGID()]], [[GETUID()]], [[STRCOMPARE()]], [[STREXTRACT()]], [[SUBSTR()]] | |
==Description== | ==Description== | ||
+ | The STRCMP() function compares two strings, character by character, and returns a numeric value as follows: | ||
+ | {| class="wikitable" | ||
+ | !Return Value||Description | ||
+ | |- | ||
+ | |-1||<expC1> is less than <expC2> | ||
+ | |- | ||
+ | |0||<expC1> and <expC2> are identical | ||
+ | |- | ||
+ | |1||<expC1> is greater than <expC2> | ||
+ | |- | ||
+ | |} | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | + | cUSERPRIVS = [YYYNNYNN] | |
+ | if strcmp(cUSERPRIVS,'NNNNNNNYN')= 0 | ||
+ | SysMaint() | ||
+ | else | ||
+ | return | ||
+ | endif | ||
</code> | </code> | ||
− | |||
+ | ==Products== | ||
+ | Recital Server, Recital | ||
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Functions]] | [[Category:Functions]] |
Revision as of 11:39, 13 October 2009
Class
Expressions And Type Conversion
Purpose
Function to compare two strings
Syntax
STRCMP(<expC1>,<expC2>)
See Also
AT(), CHROVERLAP(), GETGID(), GETUID(), STRCOMPARE(), STREXTRACT(), SUBSTR()
Description
The STRCMP() function compares two strings, character by character, and returns a numeric value as follows:
Return Value | Description |
---|---|
0 | <expC1> and <expC2> are identical |
1 | <expC1> is greater than <expC2> |
Example
cUSERPRIVS = [YYYNNYNN] if strcmp(cUSERPRIVS,'NNNNNNNYN')= 0 SysMaint() else return endif
Products
Recital Server, Recital