Overview of Calling Externals [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
Overview of Calling Externals
In general, programming languages provide an automatic interface for
calling externals. That interface provides a correspondence between each
parameter in the call to the external routine and each parameter in the
called routine. The parameters are passed in a ordered list, and the
programming language does most of the work required for type checking
(ensuring that corresponding parameters are of compatible data types).
Another approach to parameter passing is to allow the calling program to
make the external call with any list of actual parameters that the
programmer writing the calling program chooses. The ordered list of
actual parameters is passed to the called routine as a single table.
This table of actual parameters contains information about each
parameter. Although the table is ordered, the length of the table is not
fixed. The called routine accepts the table as its formal parameter.
That routine has the responsibility for performing any type checking
required for correct execution of the routine.
This appendix explains the requirements for writing HP Business BASIC/XL
programs to call externals that expect an actual parameter table as the
external routine's formal parameter. Limit the use of this feature to
those situations in which you perceive that the HP Business BASIC/XL
standard external call feature is too restrictive. For example, you may
want an external routine that prints values of HP Business BASIC/XL
variables to a file. Rather than writing an external routine for each of
the HP Business BASIC/XL data types, you can write a single routine to
process variables that have any HP Business BASIC/XL data type passed as
an actual parameter. In this case, the external must perform any
necessary type checking, since HP Business BASIC/XL will pass variables
of any type.
MPE/iX 5.0 Documentation