In my application I have two scripter related forms, one where the customer can design a scripter form and save the files. This is very similar to theDelphiformediting demo. On another form I want to run scripter with that saved files, but without the IDE components in this case. The operator should be able to watch that script form from but not to change it. I have two pascal files, the main unit uTeilebild.pas :
First comment: although it's not related to the problem, please use TatScripter instead of TatPascalFormScripter, which is deprecated.
About your problem, it must be that you are executing a different script. When using scripter component, you must be sure you have set the correct script as the current script using Currentscript property (which should be the uTeilebild.psc).
Also, the .ssproj is not used by scripter, it's only used by TIDEEngine component. If you want to use the same project approach, use TIDEEngine to load the project and then execute it.
Although I added the VCL form FormTBCarrier with the AddComponent method, I get an error message if I want to make this form the parent of the scripts form.
The script code in uTeilebild.psc has been slightly expanded :
The errormessage is 'Unknown identifier or variable is not declared : FormTBCarrier
source Position 8,35'.
Without the reference to FormTBCarrier the script form is displayed without Errors.
I try to integrate the script form seamlessly in my existing vcl form so there is no visual or behavioural difference to the VCL form. I hope this is possible.
I wanted to inform you that there must be some problem with the AddComponent function. I know that it is just a helper function but in my application AddObject works and AddComponent does not. I made absoluteley sure that the same name is used in the call of them and this is what I tried to tell you.
Since I have a working solution there is no need to hurry.
Maybe I can manage to prepare a demo project to illustrate the problem.
There is no problem, that's what I'm trying to say to you. TMS Scripter can't "read" Delphi variable names. It does not know the name of the component from your Delphi variable. It knows the name of the component from the Name property of the component. For example, to make your code work with AddComponent, you need to add this line before calling AddComponent:
pOwnForm.Name := 'pOwnForm';
atscripter1.AddComponent( pOwnForm );
Usually AddComponent works fine because the name of the component is set to the correct value. Which is not your case here, so there is no way scripter would register such instance as "pOwnForm" without having the Name property of the component set properly.