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

G- 29
temp_integer := sinteger_value;
writeln( tstfil, 'SHORT INTEGER ', temp_integer:1 );
end; { short integer }
c_integer_type:
writeln( tstfil, 'INTEGER ', integer_value:1 );
c_short_real_type:
writeln( tstfil, 'SHORT REAL ', short_value );
c_real_type:
writeln( tstfil, 'REAL ', real_value );
c_whole_string_type:
writeln( tstfil, 'STRING ', string_value.pascal_string_view );
otherwise
writeln( tstfil,'error in passed type');
end { case }
end { with }
end; { procedure process_scalar }
$title 'ANYPARM_EXAMPLE/Example of ANYPARM external testing all BASIC types'$
$page$
{----------------------------------------------------------------------------}
{ main of ANYPARM_EXAMPLE }
{----------------------------------------------------------------------------}
begin { anyparm_example }
{----------------------------------------------------------------------------}
{ TESTFILE is opened in append mode so that information written to the file }
{ by previous calls is not overwritten. }
{----------------------------------------------------------------------------}
append( tstfil, 'testfile' );
write_header( num_params, tstfil );
{----------------------------------------------------------------------------}
{ Check to ensure that the number of actual parameters passed can be }
{ processed by the external. }
{----------------------------------------------------------------------------}
if num_params > c_max_num_parameters then
begin { too many parameters to process }
writeln( tstfil, ' Too many actual parameters passed to ANYPARM_EXAMPLE' );
writeln( tstfil, ' Maximum number is: ', c_max_num_parameters:1 )
end { too many parameters to process }
else
begin { anyparm_example's actual parameter array is large enough }
{-------------------------------------------------------------------------}
{ Process each of the entries in the actual parameter table referenced by }
{ the formal parameter, p_actual_parameter_array. }
{-------------------------------------------------------------------------}
for param_index := 1 to num_params do
begin { for loop processing of the parameters }
{----------------------------------------------------------------------}
{ Write the number of the parameter, the value(s) of which are about }
{ to be written. }
{----------------------------------------------------------------------}
write( tstfil, param_index:3, ' ' );
{----------------------------------------------------------------------}
{ Do the appropriate processing dependent upon the dimensionality of }
{ the parameter in the actual parameter array currently being }
{ processed. }
{----------------------------------------------------------------------}