Record tab for C External Function
Use the Record tab to manually build the list of parameters (records) that will be passed to the external function.
When VA Smalltalk calls the external function, it can pass the function one or more records, each of which can contain input and output fields. When the function completes, any output fields are filled in with the output values for the function.
Specify information in these fields only if you do not specify information in the fields on the Prototypes tab.
If the external function does not require any parameters, you can leave the fields on this tab and the Prototypes tab blank.
Fields
File to Parse
In the File to Parse field, type the name of the C header file or COBOL copybook file declaring the data types or records used by the external function.
To list the available files, select Find. To view the contents of a file, select View.
When you have specified the file you want to use, select Parse.
Parse
Select Parse to have VA Smalltalk read the C header file or COBOL copybook file and build a list of records. From the list, you can manually build the parameter list to use with the external function.
The records (or potential parameters) appear in the Available list.
The parameters you select appear on the external function part's public interface. Then, other parts can set or retrieve the values contained in the records.
Parameter word size
Under Parameter word size, select the word size used for system dependent data types:
16 bit
32 bit
Note:
This setting does not apply to the COBOL External Function part.
Alignment
Use the Alignment spin button to specify the byte alignment for the record structure.
Set this value to the same value you used when you compiled the DLL. Refer to the appropriate compiler documentation for more information about byte alignment.
Note:
This setting does not apply to the COBOL External Function part.
Available
The Available records list shows a list of all of the record formats, or data types, defined in the file specified in the File to Parse field.
If you are working with a C External Function, for a C header file, these are all of the data types declared with typedef or struct.
If you are working with a COBOL External Function, for a COBOL copybook file, these are the record formats declared by 01-level and 77-level declarations. The items specified in the PROCEDURE DIVISION USING statement or "ENTRY" statement should compose the list of the To be passed.
The Available records list has a pop-up that is useful when building multiple external function parts from the same source file. The two pop-up menu choices are:
Load from file
Allows you to load the records directly from a source file, which can be quicker than parsing the file.
Save to file
Allows you to save parsed information in a saved object table. You can then use the Load from file option to load the records in another external function part.
Working with records
To specify that one of these records is to be passed to the external function, select the record you want and then select Add. The selected record appears as the last item in the To be passed list.
To insert the record currently selected in the Available records list into the To be passed list, select Add after. The new record is inserted immediately after the record currently selected in the To be passed list.
When working with C external functions, to place the record currently selected in the Available records list into the To be returned field, select Return. The To be returned field indicates what type of record is returned by the function.
To be passed
The To be passed list shows all of the record formats selected to be passed to the external function.
The records are passed in the order in which they appear in the To be passed list.
To remove a record from the To be passed list, select the record you want to remove and then select Remove.
To be returned
The To be returned field shows what type of record is returned by the function.
To fill in this field, select the appropriate record in the Available records list; then select the Add return record push button.
Last modified date: 01/29/2015