The procedure SendInternalMsg(....);
is no longer available.
Replaced by
procedure SendInternalMsg1(const Msg: String);
procedure SendInternalMsg2(const Msg,Arg1: String);
procedure SendInternalMsg3(const Msg,Arg1,Arg2: String);
procedure SendInternalMsg4(const Msg,Arg1,Arg2,Arg3: String);
procedure SendInternalMsg5(const Msg,Arg1,Arg2,Arg3,Arg4: String);
procedure SendInternalMsg6(const Msg,Arg1,Arg2,Arg3,Arg4,Arg5: String);
The local variable result
is no longer allowed.
So for example,the code
procedure Test;
var result : integer;
begin
for result:= 1 to 10
do writeln('hello');
end;
Will fail on compile.
The var result : integer;
Must be replaced by another variable name. Like
procedure Test;
var res : integer;
begin
for res:= 1 to 10
do writeln('hello');
end;
The new script module (FastScript) is up to 10 x faster than the old version (hollyhock 1.01.007). For compatibility reasons the slower version (Script) is still functional.
An option in the setup let you to decide if Usine will try to convert automatically slow scripts into the faster version. If it's possible (see bellow). Open the setup-expert and activate the option convert scripts to fast scripts if it's not.
Most of slow scripts can be converted without any extra work except those which contain TStringlist objects. On such scripts you'll have to do it manually and apply the following rules:
Create a new script module and copy the old script code into the new one.
Assume that you have a variable SL declared as TStringlist.
var SL : TStringList;
SL := TStringList.Create; --must be replaced by --> SL.create;
SL.CommaText := 'a,b,c'; --must be replaced by --> SL.SetCommatext('a,b,c');
s := SL.CommaText; --must be replaced by --> s := SL.GetCommatext;
s := SL.strings[i] --must be replaced by --> s := SL.GetStrings(i);
SL.strings[i] := s; --must be replaced by --> SL.SetStrings(i,s);
A more complete example
//old version
procedure Init;
var SL : TStringList;
begin
SL := TScringList.create;
SL.CommaText := 'a,b,c,d';
for i := 0 to SL.count-1
do SL.strings[i] := SL.strings[i]+inttostr(i);
trace(SL.CommaText);
SL.free;
end;
// new version
procedure Init;
var SL : TStringList;
begin
SL.create;
SL.SetCommaText('a,b,c,d');
for i := 0 to SL.count-1
do SL.SetStrings(i,SL.GetStrings(i)+inttostr(i));
trace(SL.GetCommaText);
SL.free;
end;
Now your script will compile and run at least 10x faster.
version 4.0.191119
Edit All Pages