Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>posequal()</b> http://www.X-Hacker.org [<<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()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson