The first step is to write the script and check that it works properly before running it from a Visual Adelia program. A script is a .vbs file that can be edited in any text editor. However, running Visual Basic Editor (from Microsoft Word or Microsoft Excel) is a very practical solution, as it lets you run macros step by step. All you need to do is create a macro and call the function from it.
Macro which calls a function under development
Sub Macro()
Dim Return
Return = FunctScript(1, 2)
End Sub
Function that will be in the script
Function FunctScript(long1, long2)
'*****************************
Dim TabReturnValue(1)
Dim Product
Dim Sum
Product = long1 * long2
Sum = long1 + long2
TabReturnValue(0) = Product
TabReturnValue(1) = Sum
FunctScript = TabReturnValue
End Function
Note: A few scripts are included in the ";Samples\VBscript"; directory created when you install Adelia Studio. The scope of Adelia Studio does not, however, cover understanding the script writing process or the scripting language VBScript or learning about the COM objects provided by target applications.