[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
POSEQUAL()
Finds the first position at which two strings are the same
------------------------------------------------------------------------------
Syntax
POSEQUAL(<cString1>,<cString2>,[<nCompare>],
[<nIgnore>]) --> nPosition
Arguments
<cString1> and <cString2> Designate the two character strings
that are compared.
<nCompare> Designates the number of characters that must be the
same. The default value is the length of the shorter string.
<nIgnore> Designates the number of characters that are disregarded
at the beginning of the search. The default value is none.
Returns
POSEQUAL() returns the position from which the two character strings are
the same for <nCompare> characters. If no corresponding agreement is
found, the function returns 0.
Description
POSEQUAL() allows you to determine at which point two strings agree.
The length of this agreement is represented by <nCompare>. If not
specified, <nCompare> defaults to the length of the shorter string.
Additionally, the <nIgnore> parameter lets you specify a particular
number of characters that are excluded from the start of the strings
during the comparison.
Examples
. In this example, there is no agreement to the end of the
string:
cString1 := "ABCDEFGHI"
cString2 := "XYZDEKLMN"
? POSEQUAL(cString1, cString2) // Result: 0
. This example shows the agreement of at least two characters:
? POSEQUAL(cString1, cString2, 2) // Result: 4
. This example shows a single character agreement and excludes
the first four characters:
? POSEQUAL(cString1, cString2, 1, 4) // Result: 5
See Also:
POSDIFF()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson