summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--matheunit.pas13
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);