background image
<< Creating and Editing .sbl Library Source Files | Using Filters to Open SQA Basic Files >>
<< Creating and Editing .sbl Library Source Files | Using Filters to Open SQA Basic Files >>

SQABasic Header Files

Adding Features to GUI Scripts
3-16
Using Library Source Files
To use an SQABasic library file at runtime, you must:
Add custom procedures to the library source file.
Compile the file. Both types of SQABasic library source files (extensions .sbl
and .rec) compile to a .sbx runtime file.
Declare the file in an SQABasic header file or directly in a script or library file
that will call the custom procedures.
Here is an example of declaring the sub procedure
myProc
in the library file
Mylibrary.sbx:
Declare Sub myProc BasicLib "Mylibrary" (arg as Integer)
And here is an example of declaring the function
myFunc
in the .dll file
Mylibrary.dll:
Declare Function myFunc Lib "Mylibrary" (ByVal PassVar) as Integer
For information about adding custom procedures to SQABasic library files and
about declaring library files (including .dll files), see the SQABasic Language Reference.
For information about compiling SQABasic library source files, see Compiling Scripts
and SQABasic Library Source Files
on page 5-7.
SQABasic Header Files
Header files let you declare custom procedures, constants, and variables that you
want to make available to multiple script and library source files.You can use Robot
to create and edit SQABasic header files. They can be accessed by all modules within
the project.
SQABasic files are stored in the SQABas32 folder of the project, unless you specify
another location. You can specify another location by clicking Tools >
General
Options. Click the Preferences tab. Use the Browse button to find the location.
Robot checks this location first. If the file is not there, it looks in the SQABas32
directory.
SQABasic header files have the extension .sbh.
Creating and Editing Header Files
To create a new header file that can be accessed by any module in the project:
1. Click File
>
New
>
SQABasic File.
2. Click Header File and click OK.
You name the file (or accept the default name) the first time you save it.