Difference between revisions of "STRCMP()"

From Recital Documentation Wiki
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==Class==
 
Expressions And Type Conversion
 
 
 
 
==Purpose==
 
==Purpose==
Function to compare two strings
+
Case-sensitive function to compare two strings
  
  
Line 12: Line 8:
  
 
==See Also==
 
==See Also==
[[AT()]], [[CHROVERLAP()]], [[GETGID()]], [[GETUID()]], [[STRCOMPARE()]], [[STREXTRACT()]], [[SUBSTR()]]  
+
[[AT()]], [[CHROVERLAP()]], [[GETGID()]], [[GETUID()]], [[STRCASECMP()]], [[STRCOMPARE()]], [[STREXTRACT()]], [[SUBSTR()]]  
  
  
Line 22: Line 18:
 
!Return Value||Description
 
!Return Value||Description
 
|-
 
|-
|-1||<expC1> is less than <expC2>
+
|&#045;1||<expC1> is less than <expC2>
 
|-
 
|-
 
|0||<expC1> and <expC2> are identical
 
|0||<expC1> and <expC2> are identical
Line 29: Line 25:
 
|-
 
|-
 
|}
 
|}
 +
 +
 +
The STRCMP() function does a case-sensitive comparison.  The [[STRCASECMP()]] function can be used for case-insensitive comparison.
  
  

Latest revision as of 16:24, 8 December 2009

Purpose

Case-sensitive function to compare two strings


Syntax

STRCMP(<expC1>,<expC2>)


See Also

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


Description

The STRCMP() 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 STRCMP() function does a case-sensitive comparison. The STRCASECMP() function can be used for case-insensitive comparison.


Example

cUSERPRIVS = [YYYNNYNN]
if strcmp(cUSERPRIVS,'NNNNNNNYN')= 0
    SysMaint()
else
    return
endif


Products

Recital Server, Recital