Difference between revisions of "CHROVERLAP()"

From Recital Documentation Wiki
Jump to: navigation, search
 
Line 36: Line 36:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:Expressions and Type Conversion]]
 +
[[Category:Expressions and Type Conversion Functions]]

Revision as of 15:02, 2 June 2009

Class

Expressions and Type Conversion


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


Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer