Any demo for TatPascalFormScripter

Can you please provide example for How to use TatPascalFormScripter !

Hello Dave, there are plenty of demos installed along with TMS Scripter trial or registered version.

I found 4 demos - Excel, Word, ADO and Outlook - uses this Control !
But could not find anywhere explaining when do you use TatPascalScipter or TatPascalFormScripter !

in Help file there not much explaing about TatPascalFormScripter!

Really would like to see some demo explain what it says in help

Will appreciate some one explain with little more details with example !

TatPascalFormScripter is just a regular TatScripter which happens to register all components in the form. All its usage is pretty much the same as the regular scripter, the only difference is that you can already "use" the controls in the form, like

Button1.Caption := 'some caption'

I consider TatPascalFormScripter deprecated, you don't need it. Just use a regular scripter and if you want access components in the form, register the form:

atScripter1.AddForm(Self);

As you explain my under standing is when you register the Form then you can refer all the control on the form in scirpt ! But not working for me !

Attached here my TEST project for you to review what I am missing ?

When I RUN this error

image

TestProject1.zip (56.3 KB)

I am testing in Delphi-TOKYO

When you use AddForm, the form gets available via its name. You can use it this way:

Form1.Button1.Caption := 'TEST';

If you want all the properties, methods and components of the form to be available directly, as if your code are inside the TForm1 class (but note that's not the case), then you can "use" the object:

   atScripter1.AddForm(self);
   atScripter1.UsesObject(Self);

This way you can access the button directly:

Button1.Caption := 'TEST';

Thanks for help and explaining !
Dave

1 Like

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.