Adding Features to GUI Scripts
Header and Library Source File Examples
The following examples show how a script can reference:
Variables and constants declared in a header file.
Procedures declared in the header file and defined in a library source file.
To run the example, type the contents of each example file into an empty .rec script
file, .sbh header file, and .sbl library source file. Before attempting to run the script,
save the .sbh file and compile the .sbl file.
The examples and the names you should assign the files are:
Example Script Assign any name to this script.
Example Header File Name the script tstHeader.sbh
Example Library Source File Name the script tstLibrary.sbl
Run this example with the example library and header files:
'Initially Recorded: 01/17/00 18:12:16
'Script Name: testscript
userInput = InputBox("Type a number:
Example Library Source File (Tstlibrary.sbl)
Run this example with the example script and header files. Be sure to compile the
library source file to an .sbx file before you run the script that calls the custom
procedure defined in the library file:
Sub compareNumbers(inputVal as Integer, constVal as Variant)
Dim txt as String
If inputVal > constVal then
txt="You typed a number greater than "
ElseIf inputVal < constVal then
txt="You typed a number less than "
txt="The number you typed equals "
MsgBox txt + constVal
NOTE: These examples are also provided in the Robot Help. (See header files in
the Help Index.) You can copy the examples from the Help into your own files.