Comfortable use of VB-Scripting with Powerdesigner
As you gettin started using the scripting engine PD provides …
.. you have only a simple code window under the menu Tools>Execute Commands>Edit/Run Script
For myself, since ever a MS-Access developer, i found it more comfortable to use the VBA Editor of Access 2007 (or any other version).
To do so, you need one important Step in Access, that is loading all the PD libaries, so you can use CODE-Completion !!!
Just open Extras/Libaries
As you can find elsewhere in the PD-documentation, the code in VBA differs slightly from VBS, but thats worth the step 😉
here are some starter functions you might always use:
Option Compare Database
Dim pd_App As PdCommon.Application
Dim InputModel As PdEAM.Model ' change here as needed to CDM or PDM !
Dim STList, PDMList
' opens the Application PD and the Model YOURMODELNAME only if not loaded already!!!
If pd_App Is Nothing Then
Set pd_App = New PdCommon.Application
If InputModel Is Nothing Then
Set InputModel = pd_App.OpenModel(YOURMODELNAME)
With VBA in Access ( also Excel or Word) you have debugging and watch/inspect available, you can typequalify the variables (VBS supports only VARIANT) and so you have code completion.
PS: see http://scn.sap.com/docs/DOC-44233 for some more information on VBS vs. VBA (OLE Automation)