CHROVERLAP()

From Lianjapedia
Revision as of 07:58, 4 February 2013 by Helen.george (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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