Make your own free website on
3.2.16. COMPARE(string1,string2[,padchar])

This function will compare string1 to string2, and return a whole
number which will be 0 if they are equal, otherwise the position
of the first character at which the two strings differ is
returned. The comparison is case-sensitive, and leading and
trailing space do matter.

If the strings are of unequal length, the shorter string will be
padded at the right hand end with the padchar character to the
length of the longer string before the comparison. If a padchar is
not specified, <space> is used.

     COMPARE(‘FooBar’, ‘Foobar’)        –>   ‘4’
     COMPARE(‘Foobar’, ‘Foobar’)        –>   ‘0’
     COMPARE(‘Foobarrr’, ‘Fooba’)       –>   ‘6’
     COMPARE(‘Foobarrr’, ‘Fooba’, ‘r’ ) –>   ‘0’