HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
G- 23
c_real_type = 13;
$page$
{----------------------------------------------------------------------------}
{ The Actual Parameter Table }
{ An array of records describing the address, type and dimensionality of }
{ each of the actual parameters. t_parameter_record, a record which }
{ contains fields for the address, type and dimensionality of a single }
{ actual parameter in the actual parameter table, is defined. }
{ t_short_basic_string_type is defined to allow processing of strings. }
{ External declarations are made for the functions which process decimal }
{ values. }
{----------------------------------------------------------------------------}
const
c_max_num_parameters = 50;
c_short_basic_string_max_length = 400; { bytes }
type
t_parameter_record = packed record
param_address : tp_basic_data_type;
param_type : shortint;
number_of_dimensions: shortint;
end;
t_actual_parameter_array = array [1..c_max_num_parameters] of
t_parameter_record;
tp_actual_parameter_array = ^t_actual_parameter_array;
t_short_basic_string_type =
record
max_len : integer;
case integer of
0: (actual_len : integer;
case integer of
0: ( bytes: packed
array [1..c_short_basic_string_max_length] of char );
1: ( words:
array [1..c_short_basic_string_max_length div
c_bytes_per_32_bit_word] of integer )
);
1: (pascal_string_view: string[c_short_basic_string_max_length]);
end;
A Pascal ANYPARM Procedure Designed to Process Any Parameter
This section contains an example procedure that can process any of the
Business BASIC/XL data types. The procedure uses the file of definitions
shown in the previous section as an include file. The procedure is
followed by the HP Business BASIC/XL program that calls this procedure.
The section also contains a display that shows a logical representation
of memory during the ANYPARM call to the Pascal procedure.
$standard_level 'os_features', os 'MPE/XL'$
$partial_eval on, literal_alias on$
$tables on, code_offsets on$
$diagnostic 'mapinfo_on'$
$optimize 'level2'$
$subprogram$
program pascal_example( input, output );
$include 'anyparm.decls.basic'$
$title 'ANYPARM_EXAMPLE/ANYPARM external testing all valid BASIC types',page$
{----------------------------------------------------------------------------}
{ ANYPARM_EXAMPLE }
{ }
{ This procedure is written to accept a pointer to an actual parameter table }