Chapter 9 Accessing objects using VBScript


Using the Edit/Run Script editor

The Edit/Run Script editor runs in the PowerDesigner environment and provides access to the scripting environment. You open it from the Tools→Execute Commands menu. It is available whatever the type of the active model and also when no model is active.

You can see the date and time when the script begins and ends in the Script tab of the Output window located in the lower part of the PowerDesigner main window, if you have used the Output global function.

The Edit/Run Script editor looks like the following:


The following tools and keyboard shortcuts are specific to the Edit/Run Script editor toolbar:

Tool Description Keyboard shortcut

Editor Menu
Note: When you use the Find feature, the parameter "Regular Expression" allows the use of wildcards in the search expression. For more information, see "Finding body of text using regular expressions" in the "Using the PowerDesigner interface" chapter
shift + F11

Edit With. Opens the previously defined default editor or allows you to select another editor if you click the down arrow beside this tool ctrl + E

Run. Executes the current script F5

Scripting Reference Guide. Opens pdvbs11.chm ctrl + F1

For more information on defining a default editor, see "Defining a text editor" in the "Using the PowerDesigner Interface" chapter.

Script bookmarks

In the Edit/Run Script editor window, you can add and remove bookmarks at specific points in the code and then navigate forwards or backwards from bookmark to bookmark:

Keyboard shortcut Description
ctrl + F2 Adds a new bookmark. A blue bookmark box appears. If you repeat this action from the same position, the bookmark is deleted and the blue marker disappears
F2 Jumps to bookmark
shift + F2 Jumps to previous bookmark

Visual Basic

If you have Visual Basic (VB) installed on your machine, you can use the VB interface for your script writing in order to have access to the VB IntelliSense feature that checks all the standard methods and properties that you invoke and suggests the valid alternatives ones that you can choose in order to correct the code. However the PowerDesigner Edit/Run Script editor automatically recognizes VBScript keywords.

The Edit/Run Script editor lets you:

 


Copyright (C) 2005. Sybase Inc. All rights reserved.