From e1860dcf185960c6fc3fcf5f7417b3814c55f50f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 14 Aug 2017 14:33:32 +0200 Subject: matheunit.pas: tKnownValues kann jetzt von Original kopiert kreiert werden --- matheunit.pas | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/matheunit.pas b/matheunit.pas index d186e27..20f6e6b 100644 --- a/matheunit.pas +++ b/matheunit.pas @@ -19,7 +19,8 @@ type kvs: array of tKnownValue; function finde(nam: string): longint; inline; public - constructor create; + constructor create; overload; + constructor create(original: tKnownValues); overload; destructor destroy; override; procedure add(val: tKnownValue); inline; overload; procedure add(nam: string; val: extended); overload; @@ -64,6 +65,16 @@ begin add('π',pi); end; +constructor tKnownValues.create(original: tKnownValues); +var + i: longint; +begin + inherited create; + fillchar(kvs,sizeOf(kvs),#0); + for i:=0 to length(original.kvs)-1 do + add(original.kvs[i]); +end; + destructor tKnownValues.destroy; begin setLength(kvs,0); -- cgit v1.2.3-70-g09d2