HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
G-: 28
otherwise
writeln( tstfil,'error in passed type')
end { case }
end { with }
end; { procedure process_array }
$title 'PROCESS_SCALAR of ANYPARM_EXAMPLE',page$
{----------------------------------------------------------------------------}
{ procedure process_scalar of anyparm_example }
{----------------------------------------------------------------------------}
procedure process_scalar(
p_actual_param_table : tp_actual_parameter_array;
param_index : integer;
var tstfil : text
);
var
temp_real : longreal; { used for conversion from dec and short dec }
temp_integer : integer;
begin { procedure process_scalar }
{----------------------------------------------------------------------------}
{ First de-reference the pointer for the associated fields specified. }
{----------------------------------------------------------------------------}
with p_actual_param_table^[param_index].param_address^.scalar_value do
{ short_decimal_value }
{ decimal_value }
{ sinteger_value }
{ integer_value }
{ short_value }
{ real_value }
{ string_value.pascal_string_view }
begin { with }
{-------------------------------------------------------------------------}
{ Process the actual parameter by selecting the processing appropriate }
{ for that type. }
{-------------------------------------------------------------------------}
case p_actual_param_table^[param_index].param_type of
c_short_decimal_type:
begin { short decimal value }
bb_sdtor( c_convert_short_decimal_to_real
, short_decimal_value
, temp_real
);
writeln( tstfil, 'SHORT DECIMAL ', temp_real );
end; { short decimal value }
c_decimal_type:
begin
{-------------------------------------------------------------------}
{ Check to ensure that there will not be a numeric overflow when }
{ the decimal value is converted to a real. }
{-------------------------------------------------------------------}
if ( decimal_value.decimal_rep.exponent > -308 ) and
( decimal_value.decimal_rep.exponent < 308 ) then
begin { decimal value }
bb_dtor( c_convert_decimal_to_real, decimal_value, temp_real );
writeln( tstfil, 'DECIMAL ', temp_real );
end { decimal value }
else
writeln( tstfil
, 'DECIMAL '
, 'Decimal value is too large to convert'
)
end;
c_short_integer_type:
begin { short integer }