background image
<< Global Header File | The Template File >>
<< Global Header File | The Template File >>
Example Script
Adding Features to GUI Scripts
3-18
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
.
Example Script
Run this example with the example library and header files:
'$Include "tstHeader.sbh"
Option Explicit
Sub Main
'Initially Recorded: 01/17/00 18:12:16
'Script Name: testscript
userInput = InputBox("Type a number:
")
Call compareNumbers(userInput,NMBR)
End Sub
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 "
Else
txt="The number you typed equals "
End If
MsgBox txt + constVal
End Sub
Example Header File (Tstheader.sbh)
Run this example with the example script and library files:
Global userInput as Integer
Global Const NMBR as Variant
= 10
Declare Sub compareNumbers BasicLib "tstLibrary" (arg1 as Integer,
arg2 as Variant)