Stricmp Function

Action

Performs a lowercase comparison of strings.

Include file

Kernel.bdh

Syntax

Stricmp( in sString1 : string,
         in sString2 : string ): number;

Return value

  • value < 0. sString1 is less than sString2

  • value = 0. sString1 is identical to sString2

  • value > 0. sString1 is greater than sString2

Parameter Description
sString1 Defines the first string to compare
sString2 Defines the second string to compare

Example

dcltrans
  transaction TStricmp
  var
    sString1, sString2: string;
  begin
    sString1 := "Hello world!";
    sString2 := "HELLO WORLD!";
    write("string1 = "); write(sString1); writeln;
    write("string2 = "); write(sString2); writeln;
 
    // perform lowercase comparison
    if Stricmp(sString1, sString2) = 0 then
      write("strings are equal when converted to lowercase"); writeln;
    else
      write("strings are different"); writeln;
    end;
  end TStricmp;

Output

string1 = Hello world!
string2 = HELLO WORLD!
strings are equal when converted to lowercase