Hello NewsGroup,
the following code does not work in TMS-Script:
(it's an empty form without any components)
{$FORM TForm1, Example_GlobalVar_with_Form.sfm}
uses
Classes, Graphics, Controls, Forms, Dialogs;
var
MyGlobalVar:integer;
Form1:TForm1;
procedure Form1Show(Sender: TObject);
begin
showmessage(format('Form1Show: MyGlobalVar=%d',[MyGlobalVar]));
end;
begin
MyGlobalVar:=1000;
Form1:=TForm1.create(nil);
try
Form1.showmodal;
finally
Form1.free;
end;
end;
uses
Classes, Graphics, Controls, Forms, Dialogs;
var
MyGlobalVar:integer;
Form1:TForm1;
procedure Form1Show(Sender: TObject);
begin
showmessage(format('Form1Show: MyGlobalVar=%d',[MyGlobalVar]));
end;
begin
MyGlobalVar:=1000;
Form1:=TForm1.create(nil);
try
Form1.showmodal;
finally
Form1.free;
end;
end;
Error
is: Runtime error (Line 12, Col 64): File library
Example_GlobalVar_with_Form: Illegal argument to Format function when
evaluating instruction CallProc ($1,$2,$6F3274,$328D590,'format').
Stack content is: [Integer:102327728,Null,Null].
Stack content is: [Integer:102327728,Null,Null].
Is this a bug?
Any suggestion for a "workaround".
Thank you.