Toad World® Forums

Help on the Internal Syntax used when writing Macros

Hi,
My company is currently evaluating the Toad Data Modeler (TDM) product. I have been learning how to produce some Macros written in JScript to automate certain tasks when using the product.

I have found some useful examples on:

The problem I am having is I would like to get more detailed help/descriptions of the TDM internal syntax that is used within the scripts (e.g. procedures/functions).

From looking at the user guide for the installed product, information can sometimes be found in 'Expert Mode' - 'Reference Guide' - 'Help'. Example SetLinkedObject is a procedure of the ApplicationConfig class. It tells you where it is defined (Base), its parameters, and its source is CSClasses. Beyond this there is no further detailed help/descriptions.

Some other examples of syntax encountered where I cannot find further detailed help/descriptions is shown below:

System.GetInterface
ActiveModel
ActiveWorkSpace
CreateObject
GetObject
SupportsProperty

The JScript syntax I come across in the scripts can be looked up on the web for detailed help/descriptions. However for the TDM internal syntax, there seems to little/no information.

Please could you look into this, and provide guidance if possible

Thanks very much in advance

Mr Cowlayshaw

Hello Cowlayshaw,
Description for requested methods/properties are below.

System Class

It is global object accessible from scripting by keyword "System". It has class CSAOSystem (you can find it by it in reference guide).

System.GetInterface

Name Parameters Return Type
GetInterface InterfaceName: String Dispatch

Returns object determined by parameter InterfaceName. This method doesn't create new object. It returns already existed objects.

Allowed values of InterfaceName

Value Description
PackageManager Return global object package manager (class PackageManager)
Application Return global object tdm application (class CSApplication)
REManager Return global object Reverse Eng. Manager (class REManager)
Model Return Active Model

System.CreateObject

Name Parameters Return Type
CreateObject ClassName: string Dispatch

Return object determined by ClassName.

Allowed Values for ClassName

Value Class of Return Object Description
Log CSAOLog Create log object for writing to message explorer (Method Log.Information('Some Message'))
TextStream TextStream
ReverseEngineering REManager
ReportRegistrar ReportRegistrarFactory
ImagePNG ImagePNG
PERWindowManager WindowsManager Obsolete, you can use Application instead it
OpenDialog CSAOOpenDialog
SaveDialog CSAOSaveDialog
SelectFolderDialog ICSAOSelectFolderDialog
StringList CSAOStringList
FileComparator FileComparator
DialogParams CSAODialogParams
CSVFile CSVFile
List CSAOList Be aware it is not class List.
DateTimeTDM CSAODateTimeTDM
ArgumentsParserPG Determined for RE of PG

CSApplication Classs

It is global object represented TDM application. It is accessiable by keyword "Application".

Application.ActiveModel

Name Type Attribute
ActiveModel Dispatch read-only

Return Active Model of TDM. If not any model active it will return null. Active model is model that is bold in Application View (typically has focus its designer).

Application.ActiveWorkSpace

Name Type Attribute
ActiveWorkSpace Dispatch read-only

Return Active Workspace of TDM. If not any workspace active it will return null. If some designer has focus, its workspace is active.

Base Class

Base class is parent class of almost all classes in TDM. It is abstract class.

Name Paremeters Return Type
CreateNewObject AObjectType: Integer Dispatch

CreateNewObject create object by parameter AObjectType. Object Type is number that is for each object in TDM unique. List of Object Types you can find in Reference Guide. Each object can create only classes which own. For Example: Model is able to create Entity, Procedure, Users etc. Entity is able to create Attribute,Indexes etc. So Procedure cannot create Entity etc.

Name Paremeters Return Type
SupportsProperty Name: string Boolean

Use this method to determine if class support this property. Name is name of property.

Example:

if (Ent.SupportProperty('Caption'))
  Log.Information(Ent.Caption)
else
  Log.Information(Ent.Name);

Class List

This class is used for all listed properties. For example Model.Entities, Entity.Atrtibutes etc. See reference Guide for all members.

It has basic functionality to search in list, access to list, Add to list and Remove from list.

If you have some more question to specific workflow let me know and I will describe example or something similar.

Regard
Petr

Hi Petr,

This is fantastic information. Is it all available in the product user guide?

I did raise a service request for this, and the person that was dealing with it said the dev team could not provide any further help/guidance. So thanks very much, I really appreciate it.

May have some future questions as my use of the product continues, if you don't mind.

Thanks again

Steve Cowlayshaw

Hi Steve,
the best source is reference guide available from Toad Data Modeler. Unfortunately there are not detailed description, so you don't hesitate ask us by this forum.
We would like provide support for your next customization.

Petr

Hi Petr,

I will post on the Forum when I cannot get the information I need from the user guide.

Thanks again

Steve