summaryrefslogtreecommitdiff
path: root/matheunit.pas
diff options
context:
space:
mode:
Diffstat (limited to 'matheunit.pas')
-rw-r--r--matheunit.pas12
1 files changed, 12 insertions, 0 deletions
diff --git a/matheunit.pas b/matheunit.pas
index 710a46b..ed9244f 100644
--- a/matheunit.pas
+++ b/matheunit.pas
@@ -39,6 +39,7 @@ function cmpStr(s1,s2: string): longint;
function mitte(s1,s2: string): string;
function myFloatToStr(x: extended): string;
function myStrToFloat(s: string): extended;
+function istGanzZahl(s: string): boolean;
procedure copyArray(i: tExtPointArray; out o: tExtPointArray); overload;
procedure copyArray(i: tLongintArray; out o: tLongintArray); overload;
procedure copyArray(i: tExtendedArray; out o: tExtendedArray); overload;
@@ -321,6 +322,17 @@ begin
result:=-result;
end;
+function istGanzZahl(s: string): boolean;
+var
+ i: longint;
+begin
+ result:=length(s)>0;
+ result:=result and (length(s) > byte(s[1] in ['-','+']));
+ if result then
+ for i:=byte(s[1] in ['-','+'])+1 to length(s) do
+ result:=result and (s[i] in ['0'..'9']);
+end;
+
procedure copyArray(i: tExtPointArray; out o: tExtPointArray);
var
j: longint;