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

G-: 6
Parameters
ap_external_
A valid HP Business BASIC/XL identifier that is the name
name
of the external procedure in the executable library to
be called. The maximum length of the name of the
external is 60 characters. The entry point name is
ap_external_name
in lower case unless the external is
explicitly declared with an ALIAS clause.
act_param_list
Same as the actual parameter list,
act_param_list
, in
the CALL
ap_external_name
statement. Note that
parentheses do not enclose the actual parameters when
using the underscore to make a call to an external.
Examples
The following example shows the use of the underscore in a call to an
ANYPARM External.
100 INTEGER Int1,Int2,Int3,Total
110 Int1=1;Int2=2;Int3=3;Total=0
120 _FILEPRINT "Beginning of Program","Total is:",Total
130 _ANYPARM_SUM Total,Int1,Int2
140 _ANYPARM_SUM Total,Int3,Int4
150 _ANYPARM_SUM ! No actual parameters need be associated with a call
160 _FILEPRINT "New total is:",Total
170 CALL Suba(Total,10.50)
180 _FILEPRINT "End of Program."
190 END
200 !
210 SUB Suba(INTEGER Substotal,REAL Price)
220 _FILEPRINT "Total Price is:",Substotal * Price
230 SUBEND
Resolving Name Conflicts in Calls to ANYPARM Externals
When any of the GLOBAL explicitly, local explicitly, or local implicitly
declared ANYPARM external procedures have the same name, HP Business
BASIC/XL uses a hierarchy for determining which declaration is relevant
to a specific call from within the program. The declarations are
searched in the following order:
1. Local explicit ANYPARM declarations.
2. Local implicit ANYPARM declarations.
3. GLOBAL explicit ANYPARM declarations.
Since the names of all externals in the executable library must be
unique, it is wise to give unique names to each of the externals
referenced within your HP Business BASIC/XL program. Unique names for
each external will avoid the mistake of calling non-ANYPARM externals
when using the underscore. It will also ensure that you are calling the
external that you intend to call.
The following examples are designed to clarify the actual external
procedures called when conflicts arise between the various forms of
ANYPARM external declarations. The ALIAS option has been used to allow
distinction between calls to three ANYPARM EXTERNAL procedures, Test1,
Test2, and Test3. In each example, "Call" (in the comments) refers to
the procedure actually called.
Examples
The first example demonstrates the effect of aliasing the external
procedure named Test1 to the HP Business BASIC/XL identifier, Test2.
10 ANYPARM EXTERNAL Test2 ALIAS "Test1" ! Explicit local declaration
20 CALL Test2 ! Call is made to Test1
In the following example, the explicit local declaration takes precedence
over the implicit local declaration.
10 ANYPARM EXTERNAL Test2 ALIAS "Test1" ! Explicit local declaration