Topic Path: Symbol Reference > Functions > IndyCompareStr Function
ContentsIndexHome
PreviousUpNext
IndyCompareStr Function

Compares two strings case sensitively.

File
function IndyCompareStr(
    const A1: string; 
    const A2: string
): Integer;
Parameters 
Description 
A1 
Strings value for the comparision.
 
A2 
Strings value for the comparision. 

Integer - Zero (0) when the strings are the same.

IndyCompareStr is an Integer function used to compare the string values in A1 and A2 with case sensitivity. IndyCompareStr provides a compatiblity function to isolate the differences between the .Net and other platforms. 

For the .Net platform, IndyCompareStr calls the CompareStr function in the .Net framework and compares strings based on the current locale with case sensitivity. 

For all other platforms, IndyCompareStr calls the AnsiCompareStr function. The compare operation is based on the 8-bit ordinal value of each character and is not affected by the current locale.

Most locales consider lowercase characters to be less than the corresponding uppercase characters. This is in contrast to ASCII order, in which lowercase characters are greater than uppercase characters. Thus, setting A1 to 'a' and A2 to 'A' causes AnsiCompareStr to return a value less than zero, while CompareStr, with the same arguments, returns a value greater than zero.

Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.