|
Otros manuales para este modelo:
Resumen del manual
| | |
| A Pascal ANYPARM | This section is an example program and a memory display of a |
| Procedure Designed to | call from HP Business BASIC/XL to an external procedure. The |
| Process Any Parameter | example demonstrates how to call an ANYPARM external that is |
| | capable of processing any of HP Business BASIC/XL's data types. |
| | |
--------------------------------------------------------------------------------------------
| | |
| Differences Relative | This section explains the differences between HP Business |
| to BASIC/V | BASIC/XL and BASIC/V that are relevant to the ANYPARM External. |
| | |
--------------------------------------------------------------------------------------------
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.
An Overview of ANYPARM
HP Business BASIC/XL's ANYPARM external call feature is designed to allow
external calls with any number of actual parameters to a procedure in an
Executable Library or in an object file that is linked into a compiled
program file. Multiple calls to the same external procedure within an HP
Business BASIC/XL program need not have the same number of actual
parameters if the external is designed to process those parameters.
Scalar and array variables of any HP Business BASIC/XL data type can be
passed as actual parameters. String and numeric literals are legal as
actual parameters. Also, both string and numeric functions that are
evaluated prior to the external call are legal actual parameters.
Two methods are provided for calling ANYPARM external procedures. The
first method utilizes an explicit ANYPARM EXTERNAL declaration and the
CALL statement. The second method implements calls to the external by
prefixing the name of the external to be called with an underscore. In
the second method, a local implicit external declaration is made by HP
Business BASIC/XL at the beginning of the execution of the subunit in
which the call is made.
External procedures in the executable library that are to be called using
the ANYPARM feature are written so that there are two formal parameters.
The first is the number of actual parameters passed from HP Business
BASIC/XL. The second formal parameter of the external procedure is a
pointer to a formatted table of actual parameter information. The table
contains the following information:
G-: 2
...Otros modelos de este manual:
Software - MPE/iX 6.5 Operating System (718.12 kb)
Software - MPE/iX 7.0 Operating System (718.12 kb)
Software - MPE/iX 7.5 Operating System (718.12 kb)