AddForm problem

edited 5:54AM in FastScript
Hi folks,

I'm using FastScript 1.4 (unregistered) in C++Builder 5, and am trying to use AddForm to give the scripts access to the entire form. However, I get an "Unresolved external" error message about the "AddFormA" method when Builder tries to link the project. I've got an fsFormsRTTI component on the main form and have even tried copying fs_iformsrtti.obj to the project directory, but the error message still appears. The library and search paths are correctly set up to include the FastScript "source" directory, and none of the script object's other methods have given me any trouble.

Could it simply be that the AddForm method isn't included in the trial version of FastScript, or is there something I'm doing wrongly/not doing?

Cheers,

Comments

  • edited 5:54AM
    Looks like AddForm is intersected with winspool.AddFormA or TScreen.AddForm (sic!). I introduce the new method, AddComponent which works correctly, instead of AddForm. AddForm is kept for compatibility. Change the fs_iinterpreter.pas file and recompile the FS package.
      TfsScript = class(TComponent)
      public
        procedure AddComponent(Form: TComponent);
        procedure AddForm(Form: TComponent);
      ...
    
    procedure TfsScript.AddForm(Form: TComponent);
    begin
      AddComponent(Form);
    end;
    
    procedure TfsScript.AddComponent(Form: TComponent);
    var
      i: Integer;
      v: TfsClassVariable;
    begin
    {$IFNDEF NOFORMS}
      v := FindClass(Form.ClassName);
      if v = nil then
      begin
        if Form.InheritsFrom(TForm) then
          AddClass(Form.ClassType, 'TForm')
        else if Form.InheritsFrom(TDataModule) then
          AddClass(Form.ClassType, 'TDataModule')
        else
          Exit;
        v := FindClass(Form.ClassName);
      end;
    
      for i := 0 to Form.ComponentCount - 1 do
        v.AddComponent(Form.Components[i]);
      AddObject(Form.Name, Form);
    {$ENDIF}
    end;
    
  • edited 5:54AM
    AlexTZ wrote:
    Change the fs_iinterpreter.pas file and recompile the FS package.
    I've only got the trial version just now so I don't have the .pas files for the parser and interpreter, but the supervisor of the project I'm working on has ordered the full version. Hopefully I'll have it by next week ;)

    Thanks for the fix in the meantime, I presume this will be in version 1.5 when it comes out?

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.