Workstation environment
To use call-in support, be sure to select a packaging instruction with call-in support in the XD Packager Control Panel window. On the Startup Code tab, the Application Entry Point field must specify AbtCallinSupport enable. (This is the default, so you should not change this field.)
The following code shows a sample Smalltalk application that uses call-in support to receive calls from external HLL programs. This code implements the method run in the class TestCallinApp and some methods in the class IOArea. The application containing this code must name AbtRecordStructureBaseApp as a prerequisite.
run
"Sample application to demonstrate being called externally from another
program"
| data arguments returnCode monthName dayName temp date |
Transcript cr.
Transcript show: 'Entered Smalltalk image -> executing run method'; cr.
Transcript show: 'Retreiving caller arguments'; cr.
arguments := AbtCallinSupport arguments.
(arguments callerData isNil)
ifTrue: [Transcript show: 'No data was passed in by the caller!'; cr.]
ifFalse: [
Transcript show: 'This data was passed in by the caller:'; cr.
Transcript show: ' Data Length = ',
arguments callerDataLength printString; cr.
data := IOArea address: (arguments callerData reference).
Transcript show: ' Data Area param1] = ', data param1; cr.
Transcript show: ' Data Area param2] = ', data param2; cr.
Transcript show: ' Data Area param3] = ', data param3; cr. ].
Transcript show: 'Determining month and day names for supplied date'; cr.
temp := data param3 subStrings: $/.
monthName := Date nameOfMonth: (temp at: 1) asNumber.
date := Date newDay: (temp at: 2) asNumber month: monthName
year: (temp at: 3) asNumber.
dayName := date dayName.
data param1: dayName.
data param2: monthName.
Transcript show: 'Exiting Smalltalk image -> completing run method'; cr.
returnCode := 0.
^returnCode.
The methods below go into the class IOArea. initializeAfterLoad is a public class method and the remainder are public instance methods.
initializeAfterLoad
"Initialize the fixed size for this OSPtr subclass"
self fixedSize: 45
 
param1
"Return the value of field param1"
^self abtCharArrayAt: 0
length: 15
 
param1: obj
"Set the value of field param1"
self abtCharArrayAt: 0
put: obj
length: 15
pad: 0
 
param2
"Return the value of field param2"
^self abtCharArrayAt: 15
length: 15
 
param2: obj
"Set the value of field param2"
self abtCharArrayAt: 15
put: obj
length: 15
pad: 0
 
param3
"Return the value of field param3"
^self abtCharArrayAt: 30
length: 15
 
param3: obj
"Set the value of field param3"
self abtCharArrayAt: 30
put: obj
length: 15
pad: 0
Last modified date: 07/08/2019