Can anyone help me? About Component and its Event

edited 1:56PM in FastScript
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!

Comments

  • edited 1:56PM
    I guess that the cause of it is the dymanic method bug in using fastscript
    so call somebody to help me here !
  • edited 1:56PM
    When apeared that Error,the program paused in fs_iinterpreter unit
    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;
  • edited 1:56PM
    is anyone here alive?
  • edited 1:56PM
    Did Anyone Kown?
  • edited 1:56PM
    anyone knows?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.