diff options
author | Erich Eckner <git@eckner.net> | 2017-08-14 14:33:32 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-08-14 14:33:32 +0200 |
commit | e1860dcf185960c6fc3fcf5f7417b3814c55f50f (patch) | |
tree | 5133f58208d5b81f5b35fd150ad48130175ed642 | |
parent | d2bd08bab99a3be6969aa15aea491f91e67d6bd5 (diff) | |
download | units-e1860dcf185960c6fc3fcf5f7417b3814c55f50f.tar.xz |
matheunit.pas: tKnownValues kann jetzt von Original kopiert kreiert werden
-rw-r--r-- | matheunit.pas | 13 |
1 files changed, 12 insertions, 1 deletions
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); |