Troubleshooting
Problem
This technote illustrates how to call a subroutine or function from a library in IBM® Rational® Robot. In some cases users want to call a subroutine or function from another library, or a library calls something from another library.
Resolving The Problem
All call scripts must include declarations of header file.The library file declares subroutine in itself. Then you can make functional calls in the same way like other subroutine calls.
In this example the first library LibTest1 calls the subroutine SubTest2 in library LibTest2. The libraries can be either .rec files or .sbl files.
| ' Library name: LibTest1 '$Include: "global.sbh" Declare Sub SubTest1 Sub Main Dim Result As Integer SubTest1 SubTest2 End Sub Sub SubTest1 MsgBox "LibTest1" End Sub |
| ' Library name: LibTest2 Declare Sub SubTest2 Sub Main Dim Result As Integer SubTest2 End Sub Sub SubTest2 MsgBox "LibTest2" End Sub |
| ' Header: global.sbh Declare Sub SubTest2 BasicLib "LibTest2" |
Note: The header global.sbh declares SubTest2 in LibTest1.
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
|---|
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21281444