HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 50
procedure or function in an executable library so that the procedure can
be called from within the HP Business BASIC/XL program. The purpose of
the statement is to specify the name of the procedure or function that is
called from within the HP Business BASIC/XL program. If the name in the
executable library is different from that to be used within HP Business
BASIC/XL, the name of the entry point in the executable library can be
specified in the alias clause. The formal parameter list for the
EXTERNAL statement must correspond to the formal parameter list in the
procedure header of the external routine. Parameters are passed by
reference unless the formal parameter is preceded by the keyword VALUE.
Since the language used to write the external procedure or function
determines the size and format anticipated for the actual parameters, the
language that the external procedure or function is written in must be
included in the external's definition. If the external returns a value,
(it is a function) then the type of the value returned must be specified
if it is not the default numeric type for the main program, subprogram,
or function that the definition occurs in.
Syntax
{EXTERNAL}
GLOBAL {EXT } [
lang
]
return_type identifier
[ALIAS
quoted_& str_lit
]
[[ [{,} ] ]]
[[[
ptype
]
parameter
[{;} [
ptype
]
parameter
] ...]]
Parameters
GLOBAL Allowed only if the statement is in the main block of
the program. If GLOBAL appears, the statement is a
GLOBAL EXTERNAL statement; if GLOBAL is omitted, the
statement is an EXTERNAL statement.
A GLOBAL EXTERNAL definition can appear only in the main
block of the program and allows the external to be
called from either the main block or any procedure or
function within that program. An EXTERNAL statement can
appear in the main block or any procedure or function
and allows the declared external to be called locally.
Any local EXTERNAL declaration statement takes
precedence over that of a GLOBAL EXTERNAL declaration
statement, but only while the main block or procedure
that contains the local EXTERNAL definition is
executing.
lang
One of the following terms for the language that the
external procedure or function is written in:
BASIC HP Business BASIC/XL (default if
not specified)
PASCAL Pascal/XL
PASCAL EXTENSIBLE A PASCAL/XL routine declared
using the EXTENSIBLE option. It
is followed here by the numeric
literal,
extensible_count
.
extensible_count
is the number of
required parameters for the call
to the external routine. The
required parameters must be
supplied for each call from the
HP Business BASIC/XL calling
routine. Additional non-required
formal parameters can be supplied
in the actual parameter list
following the required
parameters. Note that a call to
an EXTENSIBLE routine will pass
an additional "hidden" parameter