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

G- 19
{ [1] |<-digits[-1] ->|<- digits[0] ->|<- digits[1] ->|<- digits[2] ->| }
{ |===============================================================| }
{ [2] |<- digits[3] ->|<- digits[4] ->|<- digits[5] ->|<- digits[6] ->| }
{ |===============================================================| }
{ }
{ NOTE: By definition, if shortint_rep[1] = 0 then the value of the SHORT }
{ DECIMAL number stored at that location is zero. }
{----------------------------------------------------------------------------}
type
t_short_decimal_type = record
case integer of
0: ( sdecimal_rep : t_sdecimal_exponent_mantissa_sign_rep );
1: ( digits : t_sdec_digit_pack );
2: ( shortint_rep : t_shortint_rep_short_decimal );
3: ( integer_rep : integer );
end;
$page$
{----------------------------------------------------------------------------}
{ STRING data types }
{ An even length string declared as DIM A$[4] is stored in consecutive }
{ 32 bit words as: }
{ +-------------------------------------------+ }
{ 1 | maximum_length | }
{ +-------------------------------------------+ }
{ 2 | logical_length | }
{ +-------------------------------------------+ }
{ 3 | char1 | char2 | char3 | char4 | }
{ +-------------------------------------------+ }
{ 4 | extra | not used | | }
{ +-------------------------------------------+ }
{ An odd length string declared as DIM Str$[3] is stored as: }
{ +-------------------------------------------+ }
{ 1 | maximum_length | }
{ +-------------------------------------------+ }
{ 2 | logical_length | }
{ +-------------------------------------------+ }
{ 3 | char1 | char2 | char3 | extra | }
{ +-------------------------------------------+ }
{----------------------------------------------------------------------------}
const
c_max_str_len = 32767;
type
t_string_length = integer;
t_basic_string_type =
record
max_len : t_string_length;
case integer of
0: ( actual_len : t_string_length;
bytes : packed array [1..c_max_str_len] of char
);
1: ( pascal_string_view : string[c_max_str_len] );
end; { record t_basic_string_type }
$page$
{----------------------------------------------------------------------------}
{ The constants that represent the amount of memory allocated for each }
{ of the BASIC data types. }
{----------------------------------------------------------------------------}
const
c_sizeof_short_integer = 2; { number of bytes in a SHORT INTEGER }
c_sizeof_integer = 4; { number of bytes in a INTEGER }
c_sizeof_short_real = 4; { number of bytes in a SHORT REAL }
c_sizeof_real = 8; { number of bytes in a REAL }
c_sizeof_short_decimal = 4; { number of bytes in a SHORT DECIMAL }
c_sizeof_decimal = 8; { number of bytes in a DECIMAL }