Difference between revisions of "STRCMP()"

From Lianjapedia
Jump to: navigation, search
 
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Case-sensitive function to compare two strings
 
Case-sensitive function to compare two strings
 
  
 
==Syntax==
 
==Syntax==
 
STRCMP(<expC1>,<expC2>)
 
STRCMP(<expC1>,<expC2>)
 
  
 
==See Also==
 
==See Also==
 
[[AT()]], [[CHROVERLAP()]], [[GETGID()]], [[GETUID()]], [[STRCASECMP()]], [[STRCOMPARE()]], [[STREXTRACT()]], [[SUBSTR()]]  
 
[[AT()]], [[CHROVERLAP()]], [[GETGID()]], [[GETUID()]], [[STRCASECMP()]], [[STRCOMPARE()]], [[STREXTRACT()]], [[SUBSTR()]]  
 
  
 
==Description==
 
==Description==
 
The STRCMP() function compares two strings, character by character, and returns a numeric value as follows:
 
The STRCMP() function compares two strings, character by character, and returns a numeric value as follows:
  
 
+
{| class="wikitable" width="100%"
{| class="wikitable"
+
 
!Return Value||Description
 
!Return Value||Description
 
|-
 
|-
Line 25: Line 21:
 
|-
 
|-
 
|}
 
|}
 
  
 
The STRCMP() function does a case-sensitive comparison.  The [[STRCASECMP()]] function can be used for case-insensitive comparison.
 
The STRCMP() function does a case-sensitive comparison.  The [[STRCASECMP()]] function can be used for case-insensitive comparison.
 
  
 
==Example==
 
==Example==
Line 39: Line 33:
 
endif
 
endif
 
</code>
 
</code>
 
  
 
==Products==
 
==Products==
Recital Server, Recital
+
Lianja Server, Lianja
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Lianja VFP Extensions]]
 +
[[Category:VFP Function Extensions]]

Latest revision as of 10:14, 4 February 2013

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

Lianja Server, Lianja