Difference between revisions of "CHROVERLAP()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to test for a character existing at the same position within two strings
 
Function to test for a character existing at the same position within two strings
 
  
 
==Syntax==
 
==Syntax==
 
CHROVERLAP(<expC1>, <expC2> [, <expC3>])
 
CHROVERLAP(<expC1>, <expC2> [, <expC3>])
 
  
 
==See Also==
 
==See Also==
 
[[AT()]], [[GETGID()]], [[GETUID()]], [[STRCOMPARE()]], [[STREXTRACT()]], [[SUBSTR()]]
 
[[AT()]], [[GETGID()]], [[GETUID()]], [[STRCOMPARE()]], [[STREXTRACT()]], [[SUBSTR()]]
 
  
 
==Description==
 
==Description==
Line 15: Line 12:
  
 
This function is particularly useful for controlling users' access rights to modules within an application.  The example below shows how users' privileges can be stored in a string and checked using the CHROVERLAP() function.
 
This function is particularly useful for controlling users' access rights to modules within an application.  The example below shows how users' privileges can be stored in a string and checked using the CHROVERLAP() function.
 
  
 
==Example==
 
==Example==
Line 26: Line 22:
 
endif
 
endif
 
</code>
 
</code>
 
+
 
+
==Products==
+
Recital Server, Recital
+
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Expressions and Type Conversion]]
 
[[Category:Expressions and Type Conversion]]
 
[[Category:Expressions and Type Conversion Functions]]
 
[[Category:Expressions and Type Conversion Functions]]

Revision as of 11:41, 7 December 2012

Purpose

Function to test for a character existing at the same position within two strings

Syntax

CHROVERLAP(<expC1>, <expC2> [, <expC3>])

See Also

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

Description

The CHROVERLAP() function test for a character existing at the same position within two strings. The <expC1> defines the source string and <expC2> the test string. The CHROVERLAP() function tests each character within the test string against the equivalent character in the source string, up to the length of the source string. By default, the CHROVERLAP() function will test for the existence of the upper case letter 'Y'. The optional <expC3> can be used to test for an alternative letter. The CHROVERLAP() function returns .T. if it finds a matching occurrence of the test character within both strings.

This function is particularly useful for controlling users' access rights to modules within an application. The example below shows how users' privileges can be stored in a string and checked using the CHROVERLAP() function.

Example

cUserPrivs = "YYYNYNNY"
if chroverlap(cUserPrivs, "NNNNYNNN")
    SysMaintenanceMenu()
else
    dialog box [You are not authorized to perform this operation.]
endif