Suppose I have this function saved in a certain script:
function Add(a,b:integer):integer;
begin
result:=a+b;
end;
and I have another script which is the following:
var
a,b,c:integer;
a:=1;
b:=2;
c:=Add(a,b);
println(inttoStr(c));
how can i compile both scripts and call the 1st script from the second using dwscript in Delphi?
assuming that one file is called “file1.extension” and it’s content is:
and another file called “main.extension” with content:
you need to add the following line at the beginning of “main.extension” file:
I suggest using {$include_once …} rather than {$include …}.