Scripting Language Info

Hello,
where can I find detailed documentation on all aspects of the scripting language?
(In the help file is too small and does not explain all details)
Another question,
can I generate class functions or class procedures with scripts?

Thank you.

Here you can find a reference: http://www.tmssoftware.biz/business/scripter/doc/web/pascalsyntaxoverview.html

You can't create classes in the script code.

Thank's!


 
The question is related to the script in the data modeler...

TMS Scripter is the scripting engine used by Data Modeler, so it applies.


OK..... :-)

I have problems too.
I don't find any documentation about the Event-Functions in the Data Modeler.

for example:

procedure OnClassGenerated(Args: TClassGeneratedArgs);
begin                                                
  Args.CodeType.AddField( ... ???
end;                                                 

or

var
  Attr: TCodeAttributeDeclaration; ???

Where can I find the type: TClassGeneratedArgs and other?
In the helpfile is only a small view of some types.

I want to add some standard fields that I don't have to create in the designer.
I would also like to add a compiler directive in the initialization part.
And there are always new things added. This is difficult without help.

A textsearch for "TUnitGeneratedArgs" or "InitializationStatements" brings only this file: AureliusPluginLibrary.dll

No *.pas and no readable files

My beginning of automaticly create a column

procedure OnColumnGenerated(Args: TColumnGeneratedArgs);
begin
  if Args.Field.Name = 'FsngCreate' then
    Args.Field.AddAttribute( 'Column(''sngCreate'', [])');             
end;

procedure OnClassGenerated(Args: TClassGeneratedArgs);
begin                                                
  Args.CodeType.AddField( 'FsngCreate', 'TDateTime', mvPrivate); 
end;                                                     

The FsngCreate field is created, but the attribute not.

Ok, perhaps is this ok

  Args.CodeType.AddField( #13#10'    [Column(''sngcreate'', [TColumnProp.Required])]'#13#10'    FsngCreate', 'TDateTime', mvPrivate);

  Args.CodeType.AddProperty( 'sngCreate', 'TDateTime', 'FsngCreate', 'FsngCreate', mvPublic);                     

Indeed there is not a full documentation for thoses. But code completion works fine, if you type Args. you will see the available properties you have there.

Also, we try to add to Data Modeler documentation the most common tasks a user would like to do. Maybe these topics cover what you need?

How to create properties and fields:
https://download.tmssoftware.com/business/dmodeler/doc/web/creating-a-new-property-in-a-class.html

How to add an attribute to a class member:
https://download.tmssoftware.com/business/dmodeler/doc/web/adding-orderby-attribute-to-ma.html

In the case of adding an attribute to a field you added manually, you can simply add it right after creating the field:

Field := Args.CodeType.AddField('FAdditional', 'string', mvPrivate);
Field.AddAttribute('Column').AddRawArgument('''sngCreate''').AddRawArgument('[]');

Ok, thank you. With a little bit search, I have the best solution for me.
You make a great job, thank you.

1 Like

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