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

G-: 24
{ as the formal parameter to the procedure. The actual parameter table }
{ contains addresses referencing any of the data types. The referenced }
{ values can be either scalars or arrays. The procedure will print the data }
{ type of the value and the value itself to a file named TESTFILE. TESTFILE }
{ must be created before calling this procedure. Testfile should be created }
{ as an ASCII file with a fixed record length of 80 bytes. }
{ }
{ ANYPARM_EXAMPLE contains the following second level procedures: }
{ }
{ write_header - writes a header for the call to the file. }
{ process_string_array - writes the value of individual elements of a }
{ string array to the file. }
{ process_array - writes the value of individual elements of }
{ numeric arrays to the file. }
{ process_scalar - writes the value of all scalar types to the }
{ file. }
{ }
{----------------------------------------------------------------------------}
procedure anyparm_example( num_params : integer
; p_actual_param_table : tp_actual_parameter_array
);
var
param_index : integer; { references entry in actual parameter table }
tstfil : text; { text file to which output is written }
$title 'EXTERNAL DECLARATIONS FOR THE FUNCTIONS TO CONVERT DECIMAL TYPES',page$
{----------------------------------------------------------------------------}
{ External declarations used to convert decimals to reals and short decimals }
{ to reals. It is the caller's responsibility to check the values of }
{ parameters passed to these procedures to ensure that no overflow occurs }
{ during the conversion. }
{----------------------------------------------------------------------------}
const
c_convert_short_decimal_to_real = 3;
c_convert_decimal_to_real = 1;
procedure bb_sdtor $alias 'bb_fp_decimal_convert'$(
conversion_type : integer; { c_convert_short_decimal_to_real }
var short_dec_param : t_short_decimal_type;
var longreal_param : longreal
); external;
procedure bb_dtor $alias 'bb_fp_decimal_convert'$(
conversion_type : integer; { c_convert_decimal_to_real }
var decimal_param : t_decimal_type;
var longreal_param : longreal
); external;
$title 'ANYPARM_EXAMPLE/Example of ANYPARM external testing all BASIC types'$
$page$
{----------------------------------------------------------------------------}
{ procedure write_header of anyparm_example }
{----------------------------------------------------------------------------}
procedure write_header(
num_parms : integer;
var tstfil : text
);
begin { procedure write_header}
writeln( tstfil, ' ' );
writeln( tstfil, 'enter the external anyparm_example' );
writeln( tstfil
, 'the total number of parameters passed to anyparm_example is: '
, num_params:2
);
writeln( tstfil, 'param type' );
writeln( tstfil, '----- -------------' )
end; { procedure write_header}