Appendix: VBScript Note: You can declare local variables within each procedure, but you cannot declare global variables in this interface. In most cases, you should use tags instead. 3. Save your changes. The functions and sub-routines are added to the Global Procedures folder in the Project Explorer . Global Procedures Tree Organizing Procedures into Subfolders You can organize declared procedures into subfolders within the Global Procedures folder. To organize procedures: 1. In the Global Procedures interface, insert the following line before the procedures that you want to group together: '$region: foldername …where foldername is the name of the subfolder. For example:
Option Explicit 'Keep the Option Explicit statement in the first line of this interface. 'Procedures with global scope can be implemented here 'Global variables are NOT supported in this interface '$region:My Subroutines Sub MyMessage(message) MsgBox(message,0) End Sub '$region:My Functions Function MyAdd(number1, number2) MyAdd = number1 + number2 Call MyMessage("The sum is" & MyAdd & ".") End Function 2. Save your changes. The procedures are organized into subfolders in the Project Explorer . Importing Functions from an External File You can also import functions from an external file and add them to the Global Procedures folder.
This is useful if you have a library of existing functions that you want to reuse. To import functions: 1. Save and close all open screens and worksheets. 2. Right-click the Global Procedures folder and then choose Import… from the shortcut menu. InduSoft Web Studio Page 643