IBM Support

.sbl libraries in a subdirectory of the SQABasic directory

Question & Answer


Question

Is it possible to place an IBM® Rational® Robot .sbl file in a subdirectory of the SQABasic directory?

Cause

The .sbl file is a library source file, which contains code reusable for other scripts.

Answer

The answer is confirmative as long as you give the correct path to the library source file.

You can set the SQABasic directory in the following window:

Tools > General Options > Preferences.




In this example the SQABasic directory is

C:\prj\Laptop\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\SQABas32

If you use the library source BasicLib2.sbl, your script includes this file with the full path.

In the following example the Robot script lists five names in the Robot console. You have a Robot script that uses code from a library source file. This full path to this file is

C:\prj\Laptop\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\SQABas32\sbl\BasicLib2.sbl

The Robot script contains the following code.


'$Include "C:\prj\Laptop\TestDatastore\DefaultTestScriptDatastore\TMS_Scripts\SQABas32\sbl\BasicLib2.sbl"


Sub Main
    Dim Result As Integer
    Dim Count As Integer
 
    FillNames
    For count = 1 To Ubound(Names)
      SQAConsoleWrite Names(count)
    Next count

End Sub

You code the function in BasicLib2, which has the following content.



'$Include "header.sbh"

Sub FillNames

  Names(1) = "Gustav Mahler"
  Names(2) = "Ludwig Boltzmann"
  Names(3) = "Gustav Klimt"
  Names(4) = "Heinrich Harrer"
  Names(5) = "Stefan Zweig"
End Sub


The header header.sbh contains the array's declaration.


'Header File

Global Names(5) As String

[{"Product":{"code":"SSSHDX","label":"Rational Robot"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Scripting","Platform":[{"code":"PF033","label":"Windows"}],"Version":"2003.06.00;2003.06.10;2003.06.12;2003.06.13;2003.06.14;2003.06.15;2003.06.16;7.0;7.0.0.1;7.0.0.2;7.0.1;7.0.1.1;7.0.0.3;7.0.1.2;7.0.0.4;7.0.1.3;7.0.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21306139