HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)

G- 5
of other EXTERNALS.
Syntax
CALL
ap_external_name
[(
actual_param_list
)]
Parameters
ap_external_
An HP Business BASIC/XL identifier declared in an
name
ANYPARM EXTERNAL or GLOBAL ANYPARM EXTERNAL declaration.
act_param_list
The list of actual parameters to be passed to the
external procedure. When more than two actual
parameters are present in the list, each is separated
from the next by a comma. Two consecutive commas are
not valid. Each of the actual parameters can be a
numeric or string identifier representing an HP Business
BASIC/XL variable, or a literal, function, or expression
that is evaluated prior to calling the external. Actual
parameters that are HP Business BASIC/XL variables are
passed by reference. To pass HP Business BASIC/XL
variables by value, enclose the relevant identifier in a
set of parentheses. All other actual parameters are
evaluated, if required, and passed by value. Entire
arrays passed as parameters must include the parentheses
for the dimension information. An asterisk replaces
each of the numbers that are required to reference an
individual element of the array.
Examples
The following example shows the use of ANYPARM to call the externals
ANYPARM_SUM and fileprint. Notice that the calls here are similar to
calling any other external.
100 GLOBAL ANYPARM EXTERNAL Fileprint
110 ANYPARM EXTERNAL Sum ALIAS "ANYPARM_SUM"
120 INTEGER Int1,Int2,Int3,Int4,Total
130 Int1=1;Int2=2;Int3=3;Int4=4;Total=0
140 CALL Fileprint("Beginning of Program.","Total is:",Total)
150 CALL Sum(Total,Int1,Int2)
160 CALL Sum(Total,Total,Int3,Int4)
170 CALL Sum ! No parameters are required for the call
180 CALL Fileprint("New total is:",Total)
190 CALL Suba(Total,10.50)
200 CALL Fileprint("End of Program")
210 END
220 !
230 SUB Suba(=INTEGER Substotal,REAL Price)
235 REM Fileprint was declared as GLOBAL
240 CALL Fileprint("Total Price is:",Substotal*Price)
250 SUBEXIT
Using the Underscore to Call an ANYPARM External
The underscore is used to call external procedures in an executable
library following an implicit local external declaration. By implicit,
it is meant that no previous ANYPARM EXTERNAL statement in the HP
Business BASIC/XL program is required to declare the external procedure
name. The external to be called must be present in the executable
library or program. Implicit declaration does not allow aliasing. Use
of the underscore in a program subunit results in an implicit local
external declaration. If the underscore is used in the main subunit, the
implicit declaration is local to the main subunit. Refer to the
following section, "Resolving Name Conflicts in Calls to ANYPARM
Externals," for a description of HP Business BASIC/XL's method of
determining which procedure is called when externals with the same names
are declared both explicitly and implicitly within a program.
Syntax
_ap_external_name
[
act_param_list
]