Compares the alphabetic order of the elements in two lists pair-wise.
@Compare( textlist ; textlist ; [ options ] )
textlist
Text list. The first two parameters are text lists. If one list is shorter, the last element in the shorter list is repeated until it reaches the same length as the longer list. The corresponding elements of each list are compared.
[ options ]
Keyword list. The list can include any of the following keywords. Conflicting options result in the last specified.
[CASESENSITIVE] (default)
[CASEINSENSITIVE]
[ACCENTSENSITIVE] (default)
[ACCENTINSENSITIVE]
[PITCHSENSITIVE] (default)
[PITCHINSENSITIVE]
result
Number list. Each element is the result of comparing the corresponding elements in the text lists, and is one of three values:
The comparison sequence for the English character set is as follows: the apostrophe, the dash, the numbers 0-9, the alphabetic characters a-z and A-Z, and the remaining special characters. The sequence for the alphabetic characters is in order, lowercase character first: a, A, b, B, and so on through z, Z. This sequence can lead to some anomalies; for example, "new york" compares before "New Boston." Use the [CaseInsensitive] option, or @UpperCase, @LowerCase, and @ProperCase to address this behavior.
If you set Unicode standard sorting as the sorting option, you cannot select the following keywords or combinations:
You specify Unicode standard sorting by setting the notes.ini variable $CollationType to @UCA, or by selecting the "Unicode standard sorting" checkbox that displays in the following dialog boxes:
*The Unicode option is disabled in the Database and Design Document Properties boxes until you select a default sort order.
For more information on Unicode sorting, see http://oss.software.ibm.com/icu/
list := "Boston" : "Tokyo" : "Moscow" : "N" : "n";
result := @text(@compare(list; "N"; [CaseInsensitive]));
@Prompt([OKCANCELLIST] : [NOSORT];
"Result"; ""; ""; list + " (" + result + ")")
@If(Names1 = "" | Names2 = ""; ""; @do(
comp1 := @Compare(Names1; Names2;
[CASEINSENSITIVE] : [ACCENTINSENSITIVE]);
comp2 := @Replace(@Text(comp1); "-1" : "0" : "1";
" is less than " : " is equal to " : " is greater than ");
Names1 + comp2 + Names2))
@If(Column1 = ""; ""; @Do(
Low1 := @Compare(Column1; "A"; [CASEINSENSITIVE]);
High1 := @Compare(Column1; "Z"; [CASEINSENSITIVE]);
Low2 := @Replace(@Text(Low1); "-1" : "0" : "1"; "Does not start with alpha" : "" : "");
High2 := @Replace(@Text(High1); "-1" : "0" : "1"; "" : "" : "Does not start with alpha");
Low2 + High2))
@For(n:=1;n <= @Elements(sailboats);n := n+1;
FIELD result := @If(n=1;@If(@Compare(sailboats[n];"d";[CASEINSENSITIVE])=-1;
sailboats[n];"");@If(@Compare(sailboats[n];"d";[CASEINSENSITIVE])=-1;
result:(sailboats[n]);result)));
result
If the sailboats field contains "Hunter":"C&C":"Pearson":"Contessa":"Bristol," this formula returns "C&C;Contessa;Bristol."
StrCompare function of LotusScript® language