summaryrefslogtreecommitdiff
path: root/lowlevelunit.pas
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2015-10-22 14:25:13 +0200
committerErich Eckner <git@eckner.net>2015-10-23 09:01:42 +0200
commit07307a6e1f3c2726f99e8cd0534e1d39bcc723d1 (patch)
treef57b22c8b364f2cd58da5502bea6390a906053b1 /lowlevelunit.pas
parentb81ccffdcc682c4877b53ebe5c85fad2cc704625 (diff)
downloadunits-07307a6e1f3c2726f99e8cd0534e1d39bcc723d1.tar.xz
zusammenfassen neu in lowlevelunit.pas
Diffstat (limited to 'lowlevelunit.pas')
-rw-r--r--lowlevelunit.pas18
1 files changed, 18 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas
index 94ada62..6ca3c15 100644
--- a/lowlevelunit.pas
+++ b/lowlevelunit.pas
@@ -89,12 +89,16 @@ function mirrorBits(lw: longword): longword; overload;
function mirrorBits(w: word): word; overload;
function mirrorBits(b: byte): byte; overload;
+function zusammenfassen(s1,s2: string): string;
+
var
base64Chars: array[0..63] of char;
base64CharsInvers: array[char] of byte;
implementation
+uses matheunit;
+
var _cpuLastUsed,_cpuLastIdle: int64;
// allgemeine Funktionen *******************************************************
@@ -765,6 +769,20 @@ begin
(byte(odd(b)) shl 7);
end;
+function zusammenfassen(s1,s2: string): string;
+var
+ i: longint;
+begin
+ if istGanzZahl(s1) and istGanzZahl(s2) then begin
+ i:=strtoint(s1)+strtoint(s2);
+ result:=inttostr(i);
+ if (startetMit('+',s1) or startetMit('+',s2)) and (i>=0) then
+ result:='+'+result;
+ end
+ else if s1=s2 then result:=s1
+ else raise exception.create('Ich kann '''+s1+''' und '''+s2+''' nicht zusammenfassen!');
+end;
+
var b: byte;
begin