HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
G- 21
{----------------------------------------------------------------------------}
{ Definition of the maximum size and dimensions of each array type. }
{----------------------------------------------------------------------------}
const
c_sizeof_single_dimension_descriptor = 2 * c_bytes_per_integer; { bytes }
c_max_array_bytes_unavail =
c_bytes_per_pointer + { pointer to the data area }
c_bytes_per_integer + { stores total number of elements in array }
c_max_array_dim * c_sizeof_single_dimension_descriptor; { bytes }
{-------------------------------------------------------------------------}
{ c_max_array_bytes defines the maximum space that an array of any type }
{ may use. }
{-------------------------------------------------------------------------}
c_max_array_bytes = c_max_array_size - c_max_array_bytes_unavail;
{-------------------------------------------------------------------------}
{ Calculate the maximum index for each of the arrays. Subtract one }
{ element when calculating because the array indexing is zero based. }
{-------------------------------------------------------------------------}
c_max_sinteger_array_index =
( c_max_array_bytes - c_sizeof_short_integer ) div c_sizeof_short_integer;
c_max_integer_array_index =
( c_max_array_bytes - c_sizeof_integer ) div c_sizeof_integer;
c_max_short_array_index =
( c_max_array_bytes - c_sizeof_short_real ) div c_sizeof_short_real;
c_max_real_array_index =
( c_max_array_bytes - c_sizeof_real ) div c_sizeof_real;
c_max_short_decimal_array_index =
( c_max_array_bytes - c_sizeof_short_decimal ) div c_sizeof_short_decimal;
c_max_decimal_array_index =
( c_max_array_bytes - c_sizeof_decimal ) div c_sizeof_decimal;
{-------------------------------------------------------------------------}
{ String arrays are contained in a "word_view", so max index is word, not }
{ element, related. Individual array elements are always 4 byte aligned }
{ because the t_basic_string_type record requires 4 byte alignment. }
{-------------------------------------------------------------------------}
c_max_string_array_index = c_max_array_bytes;
c_max_string_array_word_index = c_max_array_bytes div
c_bytes_per_32_bit_word;
{----------------------------------------------------------------------------}
{ Definition of the types that describe each array that is used to store }
{ data of that type. }
{----------------------------------------------------------------------------}
type
t_bas_sinteger_array =
array [0..c_max_sinteger_array_index] of t_short_integer_type;
t_bas_integer_array =
array [0..c_max_integer_array_index] of t_integer_type;
t_bas_short_array =
array [0..c_max_short_array_index] of t_short_real_type;
t_bas_real_array =
array [0..c_max_real_array_index] of t_real_type;
t_bas_short_decimal_array =
array [0..c_max_short_decimal_array_index] of t_short_decimal_type;
t_bas_decimal_array =
array [0..c_max_decimal_array_index] of t_decimal_type;
t_string_word_view =
array [0..c_max_string_array_index div 4] of integer;
{----------------------------------------------------------------------------}
{ t_basic_array_type }
{ Definition of an array data type that has a variant for each of the data }
{ types. }
{----------------------------------------------------------------------------}
type