BEFOREP

Synopsis
BEFOREP word1 word2
BEFORE? word1 word2
Description

Outputs TRUE if word1 comes before word2. Outputs FALSE, otherwise.

By default, BEFOREP compares the words in alphabetical order, or more precisely Unicode collation order. That is, an upper case letter is equal to its corresponding lower case letter. Similarly, any two characters which are defined to be equivalent in Unicode, such as the word-final sigma (ς) and the normal sigma (σ), are also treated as equal. However, if a variable named CASEIGNOREDP is defined and its value is not TRUE, then an upper case letter is not equal to its corresponding lower case letter; the characters are compared by their Unicode code point.

If one of the words is a prefix of the other word, then the shorter word comes before the longer word.

Note that if the inputs are numbers, the result may not be the same as with LESSP. For example, BEFOREP 9 10 outputs FALSE because 9 collates after 1.

Example
SHOW BEFOREP "ABC "abd
true
SHOW BEFOREP "abd "ABC
false
SHOW BEFOREP "a "a
false
SHOW BEFOREP 9 10
false

SourceForge.net Logo