18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Overview of VBScript<br />

an External File" below.) However, if you do, then your project may behave unexpectedly during<br />

runtime. Make sure that all of your functions are named correctly.<br />

You can create as many Procedures worksheets as you want, and each worksheet can contain as many<br />

functions and sub-routines as you want.<br />

To use the Procedures interface:<br />

1. In the Global tab of the Project Explorer, do one of the following:<br />

• To edit the default Procedures worksheet, open the Procedures folder and then double-click Main<br />

Procedures; or<br />

• To create a new Procedures worksheet, right-click the Procedures folder and then click Insert on the<br />

shortcut menu.<br />

Either way, the worksheet is opened for editing.<br />

Main Procedures worksheet<br />

2. Declare your functions and sub-routines in the interface. For example:<br />

Option Explicit<br />

'Keep the Option Explicit statement in the first line of this interface.<br />

'Procedures with global scope can be implemented here<br />

'Global variables are NOT supported in this interface<br />

Sub MyMessage(message)<br />

MsgBox message, 0<br />

End Sub<br />

Function MyAdd(number1, number2)<br />

MyAdd = number1 + number2<br />

Call MyMessage("The sum is" & MyAdd & ".")<br />

End Function<br />

Note: You can declare local variables within each procedure, but you cannot declare global<br />

variables in this interface. In most cases, you should use tags instead.<br />

<strong>InduSoft</strong> Web Studio Page 761

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!