Can anyone help me? About Component and its Event
I have used fsscript to build a project!
I use delphi to create some Components in Form(Pay attention to the created component use dynamic method),then use fastcript to set the Components' events
for example:
There is a TEdit Component in Form1,it is created by dynamic method
procedure TForm1.Button4Click(Sender: TObject);
var
NedtAge: TEdit;
begin
NEdtAge := TEdit.Create(Self);
NEdtAge.Parent := Form1;
NEdtAge.Left := 152;
NEdtAge.Top := 64;
end;
Then use fastscript components to set its event
The fsscript's text :
procedure NEdtAgeOnExit(Sender: TObject);
begin
if StrToInt(Trim(form1.NEdtAge.text)) > 200 then
begin
ShowMessage('You input a wrong Age,Please input again!');
form1.NEdtAge.SetFocus;
end;
end;
begin
Form1.NEdtAge.OnExit:=@NEdtAgeOnExit;
end.
The question is:
When I first time to enter the window(form1),the project is running without errors,and the component's event can normally touch off!
But,When I close the window(form1),then enter it again
Preject show abnormity message(unkown message)
Have anybody met this problem before !
Please Help me!
Another word,I am a chinese ,English is so poor,but also hope somebody help me!
Thank you!
I use delphi to create some Components in Form(Pay attention to the created component use dynamic method),then use fastcript to set the Components' events
for example:
There is a TEdit Component in Form1,it is created by dynamic method
procedure TForm1.Button4Click(Sender: TObject);
var
NedtAge: TEdit;
begin
NEdtAge := TEdit.Create(Self);
NEdtAge.Parent := Form1;
NEdtAge.Left := 152;
NEdtAge.Top := 64;
end;
Then use fastscript components to set its event
The fsscript's text :
procedure NEdtAgeOnExit(Sender: TObject);
begin
if StrToInt(Trim(form1.NEdtAge.text)) > 200 then
begin
ShowMessage('You input a wrong Age,Please input again!');
form1.NEdtAge.SetFocus;
end;
end;
begin
Form1.NEdtAge.OnExit:=@NEdtAgeOnExit;
end.
The question is:
When I first time to enter the window(form1),the project is running without errors,and the component's event can normally touch off!
But,When I close the window(form1),then enter it again
Preject show abnormity message(unkown message)
Have anybody met this problem before !
Please Help me!
Another word,I am a chinese ,English is so poor,but also hope somebody help me!
Thank you!
Comments
so call somebody to help me here !
and point to the 1566th row
There are Part of the code in fs_iinterpreter unit
function TfsDesignator.DoCalc(const AValue: Variant; Flag: Boolean): Variant;
var
i, j: Integer;
Item: TfsCustomVariable;
Val: Variant;
Ref: TfsCustomVariable;
Temp, Temp1: array of Variant;
...........
begin
.........
Ref := Item;
{ assign a value to the last designator node if called from SetValue }
if Flag and (i = Count - 1) then
begin
Item.Value := AValue // Error Here!
end
else
begin
Item.NeedResult := (i <> Count - 1) or NeedResult;
Val := Item.Value;
end;
........
end;