Chapter 9 Generation Reference Guide (GTL)


vbscript macro

The vbscript macro is used to embed VB script code inside a template. It is a block macro.

A vbscript macro has the following syntax:

.vbscript ['(' <script-param-list> ')']
<vbscript-block-input>
.endvbscript ['(' <tail> ')']

Parameters

Parameter Type Description
<script-param-list>
(optional)
List of arguments of type simple-template separated by commas Parameters that are passed onto the script through the ScriptInputArray table
<vbscript-block-input> Text VB script text
<tail> Text Appended to the output, if there is one

Output

The output is the ScriptResultArray value.

Example:

.vbscript(hello, world)
ScriptResult = ScriptInputArray(0) + " " + ScriptInputArray(1)
.endvbscript

The output is:

hello world

Note: the active object of the current translation scope can be accessed through the ActiveSelection collection as ActiveSelection.Item(0).

For more information on ActiveSelection, see "Global properties", in the "Accessing objects using VBScript" chapter in the General Features Guide .

 


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