5 bytes each
7 bytes each
11
bytes each
Dynamic(RUN-Time) Memory Allocation
Integer variables:
(2
for value, 3 for variable name)
Single-precision variables:
(4 for value, 3 for variable name)
Double-precision variables:
(8 for value, 3 for variable name)
String variables: 6 bytes minimum
(3
for variable name, 3 for stack and variable pointers, 1for each character)
Array variables:
12
bytes minimum
(3 for variable name, 2 for total size, 1for number
of
dimensions, 2 for size
of
each dimension, and 2,
3,4
or
8 [depending on array type]
for each element in the array)
Each active
FOR-NEXT loop requires
16
bytes.
Each active (non-returned)
GOSUB requires 6 bytes.
Each level
of
parentheses requires 4 bytes plus
12
bytes for each temporary value.
GeneralFormulafor ComputingMemoryRequirements ofArrays
The array G
(Nl,
N2,
...
, Nk) requires the following amount
of
memory:
14 + (k*2) +
T*~(N1
+1)*(N2+1)*
...
*(Nk+1)~
where k is the number
of
dimensions in the array, and the value
OfT
depends on the
array type:
Type
Integer
Single-Precision
Double-Precision
String
*
T=
2
4
8
3
*In computing the actual memory requirements
of
string arrays, you must add the
text length
of
each elementin the array. When the array is first dimensioned, all
elements have length
o.
The string text will be stored in the string space (reserved by
the
CLEAR n statement).
A/17