summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lowlevelunit.pas29
1 files changed, 29 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas
index c6cfa1b..f30ca0b 100644
--- a/lowlevelunit.pas
+++ b/lowlevelunit.pas
@@ -151,6 +151,7 @@ procedure readAnAndorString(var f: file; out s: string; const len: int64; checkE
procedure readAnAndorString(var f: file; out s: string; checkEOL: boolean); overload;
procedure splitStrToInt(s: string; out ia: tLongintArray);
+function vergleicheStrings(s1,s2: string): integer;
var
base64Chars: array[0..63] of char;
@@ -1280,6 +1281,34 @@ begin
end;
end;
+function vergleicheStrings(s1,s2: string): integer;
+var
+ i: longint;
+begin
+ result:=0;
+ i:=1;
+ while (i<=length(s1)) and (i<=length(s2)) do begin
+ if s1[i]<s2[i] then begin
+ result:=-1;
+ exit;
+ end;
+ if s1[i]>s2[i] then begin
+ result:=1;
+ exit;
+ end;
+ inc(i);
+ end;
+ if length(s1)<length(s2) then begin
+ result:=-1;
+ exit;
+ end;
+ if length(s1)>length(s2) then begin
+ result:=1;
+ exit;
+ end;
+ result:=0;
+end;
+
var
b: byte;