An object of class PlatformFunction represents an external function. To create an instance of PlatformFunction, to call the function, and pass it the correct parameters, do the following:
1. Create an instance of PlatformFunction to represent the function you want to call. You must specify the following information:Creating functions manually contains a table that shows the supported calling conventions, their meaning, and the platforms supported.If a data field in a record structure is an array, VA Smalltalk Base provides additional methods you can use to set the values of the items in the array. The method selectors are based on the names of the fields with At: or At:put: appended: For example, the following COBOL declaration:
a.
b.
c.
d. The PlatformFunction method coroutineCallWith: calls the external function, passing it the parameters in the specified record structure. The argument threadKey: nil specifies that VA Smalltalk Base should not run the function in a separate thread.
a. The multiple-argument methods (such as coroutineCallWith:with: and coroutineCallWith:with:with:), which accept as many as 16 arguments
b. The coroutineCallWithArray: method, which accepts a single argument (an Array containing the record structures to be passed to the external function)To call the sample external function, create a new application called MyExtFunc, specifying MySampleCExtFunc or MySampleCOBOLExtFunc as its prerequisite (depending on the language you are using). If you are working with the C sample, add SampleCATMConstants to the list of pool dictionaries in the class definition; for the COBOL sample, add SampleCOBOLATMConstants to the pool dictionaries in the class definition.
![]() |