HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
G-: 12
Example of a Simple Pascal ANYPARM Procedure
This section contains a Pascal procedure that can be called from HP
Business BASIC/XL using the ANYPARM call interface. This procedure shows
how to define the actual parameter table that the ANYPARM call requires.
It also contains an example procedure that accepts the actual parameter
table as a formal parameter.
$title 'SIMPLE_ANYPARM_PROGRAM / SIMPLE_EXAMPLE with
INTEGER and SHORT INTEGER'$
$subprogram$
$tables on$
$code_offsets on$
$range off$
{*******************************************************************}
{* *}
{* SIMPLE_ANYPARM_PROGRAM *}
{* *}
{*Definition of the actual parameter table and the *}
{*constants and types required to process *}
{*Business BASIC/XL's SHORT INTEGER *}
{*and INTEGER data types. The addresses of the SHORT INTEGER *}
{*and INTEGER values are passed in the actual parameter table *}
{*to the procedure, SIMPLE_EXAMPLE. SIMPLE_EXAMPLE prints the *}
{*values of SHORT INTEGER and INTEGER values. *}
{* *}
{*******************************************************************}
program simple_anyparm_program;
{-------------------------------------------------------------------}
{Machine constants and types specific for the MPE XL based HP3000. }
{-------------------------------------------------------------------}
const
c_min_mchn_wrd_int = minint;
c_max_mchn_wrd_int = maxint;
type
t_mchn_wrd_int = integer;
t_half_mchn_wrd_int = shortint;
{-------------------------------------------------------------------}
{Constants representing Actual Parameter Types }
{The values in the actual parameter table that define the }
{type of the parameter. }
{-------------------------------------------------------------------}
const
c_sinteger_type = 5;
c_integer_type = 11;
{----------------------------------------------------------------}
{Scalar_value }
{The pointer and associated variant record defining the HP }
{Business BASIC/XL value's storage format in memory. }
{----------------------------------------------------------------}
type
tp_scalar_value = ^t_scalar_value;
t_scalar_value = record
case integer of
1: ( sinteger_value : shortint);
2: ( integer_value : integer );
end;
{-------------------------------------------------------------------}
{The Actual Parameter Table }
{An array of records describing the address, type and dimensionality}
{of each of the actual parameters. }
{-------------------------------------------------------------------}