Difference between revisions of "STRCASECMP()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 1: Line 1:
{{YLM to do}}
 
 
 
==Class==
 
==Class==
 
+
Expressions And Type Conversion
  
  
 
==Purpose==
 
==Purpose==
 
+
Case-insensitive function to compare two strings
  
  
 
==Syntax==
 
==Syntax==
 
+
STRCASECMP(<expC1>,<expC2>)
  
  
 
==See Also==
 
==See Also==
 
+
[[AT()]], [[CHROVERLAP()]], [[GETGID()]], [[GETUID()]], [[STRCMP()]], [[STRCOMPARE()]], [[STREXTRACT()]], [[SUBSTR()]]
  
  
 
==Description==
 
==Description==
 +
The STRCASECMP() function compares two strings, character by character, and returns a numeric value as follows:
  
 +
 +
{| class="wikitable"
 +
!Return Value||Description
 +
|-
 +
|&#045;1||<expC1> is less than <expC2>
 +
|-
 +
|0||<expC1> and <expC2> are identical
 +
|-
 +
|1||<expC1> is greater than <expC2>
 +
|-
 +
|}
 +
 +
 +
The STRCASECMP() function does a case-insensitive comparison.  The [[STRCMP()]] function can be used for case-sensitive comparison.
  
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
 
+
cUSERPRIVS = [yyynnynn]
 +
if strcasecmp(cUSERPRIVS,'NNNNNNNYN')= 0
 +
    SysMaint()
 +
else
 +
    return
 +
endif
 
</code>
 
</code>
  
==Products==
 
  
 +
==Products==
 +
Recital Server, Recital
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]

Revision as of 12:01, 13 October 2009

Class

Expressions And Type Conversion


Purpose

Case-insensitive function to compare two strings


Syntax

STRCASECMP(<expC1>,<expC2>)


See Also

AT(), CHROVERLAP(), GETGID(), GETUID(), STRCMP(), STRCOMPARE(), STREXTRACT(), SUBSTR()


Description

The STRCASECMP() function compares two strings, character by character, and returns a numeric value as follows:


Return Value Description
-1 <expC1> is less than <expC2>
0 <expC1> and <expC2> are identical
1 <expC1> is greater than <expC2>


The STRCASECMP() function does a case-insensitive comparison. The STRCMP() function can be used for case-sensitive comparison.


Example

cUSERPRIVS = [yyynnynn]
if strcasecmp(cUSERPRIVS,'NNNNNNNYN')= 0
    SysMaint()
else
    return
endif


Products

Recital Server, Recital