An IDL (Interface Definition Language) file contains definitions of the interface between client and server.
The Stub Generation from IDL function provides the option to generate stub subprograms (interface objects) and/or parameter data areas (PDAs) from EntireX IDL files.
You can generate stubs from IDL files by using either the Stub
Generation from IDL function or the command SYSRPC
SGIDL
.
The following section provides instructions for using the Stub Generation from IDL function.
To generate stubs or PDAs from an IDL file
In the SYSRPC - Remote Procedure Call window, from the Tools menu, choose Stub Generation from IDL.
Or:
In the SYSRPC - Remote Procedure Call window,
press CTRL+F7.
Or:
In the Command line, enter SYSRPC
SGIDL
.
The Input for Stub Generation from IDL File dialog box appears.
In the Path or file name text box, enter the complete path to the folder or the file that contains the IDL definitions or choose Browse to select a file from a folder.
If required, in the Library text box, enter the name of the library into which you want to generate the stub subprogram. The text box is preset to the name of the current library.
DBID, FNR is a non-modifiable text box that
displays the database ID (DBID), the file number (FNR) and the type of Natural
file (FNAT
= system, FUSER
= user) for the specified
library.
Choose OK.
The Generate Stubs from IDL window similar to the example below appears for the specified library:
All definitions contained in the selected IDL file are displayed in a tree view where the Library node indicates an EntireX RPC IDL library and each set of IDL definitions is contained in a Program node. The Comments node contains commentary text such as a description of the definitions contained in an IDL file.
Select the node(s) that contain the sets of IDL definitions from which you want to generate the stub subprogram(s) or PDA(s):
For stub subprograms:
Select the check box of a Library node to
generate stub subprograms from all Program nodes contained
in that Library node.
Or:
Select the check boxes of individual
Program nodes to generate stub subprograms from the
specified Program nodes only.
You can change the name of a stub subprogram by using a selection list as described in Building a Selection List. Otherwise, the stub subprogram will be named after the corresponding Program node.
For PDAs:
Select the Library node(s) or the required
Program node(s) and choose Mark for parameter
data area from the context menu.
A list appears that displays the set(s) of IDL definitions for each node selected as shown in the example of a selection list below. The check boxes of all IDL definitions are selected for PDA generation. You can deselect a PDA by clearing the check box next to it in either the tree view or the selection list as described in Building a Selection List.
You can change the name of a PDA as described in Building a Selection List. Otherwise, the PDA will be named after the corresponding Program node where the following conversion rules apply:
For a node name of 7 characters, an A
is added to the
PDA name. For example, node name PDATEST1
is converted to PDA name
PDATESTA
.
For a node name of 6 characters or less, an A
is
added to the PDA name in the 8th position and each empty position between node
name and A
is filled with a dash (-). For example, node name
TEST1
is converted to PDA name TEST1--A
.
Choose OK.
For each item selected, a message box appears confirming successful generation of the stub subprogram or the PDA.
You can use a selection list to change the name of a stub subprogram (interface object) or a PDA, or deselect or select the nodes from which to generate a stub subprogram and/or a PDA.
To build a selection list
In the Generate Stubs from IDL window, select the check box of a Library node or the check box(es) of Program node(s) and choose Build selection list to rename or mark object types from the context menu.
A selection list appears that displays the selected Program nodes as shown in the example below:
The selection list displays all nodes selected in the tree view
where the IDL Library (Alias) column corresponds to the
Library node and the IDL Name column
corresponds to the Program node. In the example above, the
Program nodes CALC
and POWER
are
selected for stub generation and the Program node
HELLO
is selected for PDA generation.
In the Subprogram and/or PDA columns, select the check boxes of the sets of IDL definitions from which you want to generate stub subprograms and/or PDAs.
You can deselect an item by clearing a check box.
If you want to change the name of a stub subprogram or a PDA, select the required table cell and replace the current entry.
If you want to remove one or more table rows, select the required rows and choose Clear Row(s) from the context menu.
If you want to close the selection list, choose Close Table from the context menu.