2008-06-03 11:27:19 +00:00
|
|
|
unit uReferenciasUtils;
|
|
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ Si ARef1 < ARef2 -> Result := -1
|
|
|
|
|
Si ARef1 = ARef2 -> Result := 0
|
|
|
|
|
Si ARef1 > ARef2 -> Result := 1 }
|
|
|
|
|
|
|
|
|
|
function CompararReferencias(const ARef1, ARef2 : String) : Integer;
|
|
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
JclStrings, cxVariants;
|
|
|
|
|
|
|
|
|
|
function CompararReferencias(const ARef1, ARef2 : String) : Integer;
|
|
|
|
|
var
|
|
|
|
|
Aux1, Aux2 : String;
|
|
|
|
|
Rpl : Char;
|
|
|
|
|
begin
|
|
|
|
|
Rpl := '0';
|
|
|
|
|
Aux1 := StrReplaceButChars(ARef1, AnsiDecDigits, Rpl);
|
|
|
|
|
Aux2 := StrReplaceButChars(ARef2, AnsiDecDigits, Rpl);
|
|
|
|
|
|
|
|
|
|
if StrIsDigit(Aux1) and StrIsDigit(Aux2) then
|
|
|
|
|
Result := VarCompare(StrToIntSafe(Aux1), StrToIntSafe(Aux2))
|
|
|
|
|
else
|
2008-07-31 15:48:01 +00:00
|
|
|
Result := VarCompare(Aux1, Aux2)
|
2008-06-03 11:27:19 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
end.
|