Date : Sat, 30 Oct 2004 17:13:59 +0100
From : Richard Gellman <splodge@...>
Subject: Re: Dimensioned area space
Ben Newsam wrote:
> In message <Marcel-1.53-1030153748-0b0zokP@...>, Andrew W
> <a.weston2@...> writes
>
>> If in BASIC I type:
>> DIM A%-1
>> P.A%-TOP
>> I get as expected: '0'
>>
>> If I type
>> DIM A%-1
>> P.A%-TOP
>> DIM G% 0
>> P.A%-TOP
>> I get '1' as expected (I think I expected it anyway ;-))
>>
>> However if I type:
>> DIM A%-1
>> P.A%-TOP
>> DIM GH% 0
>> P.A%-TOP
>> I get '10'
>> where is the memory going?
>
>
> The variable GH% has to be created, whereas the variable G% is already
> allocated space.
To elaborate further, A%-Z% and @% are referred to as the "System
Integers". BASIC allocates these in a separate memory space (&400-&700 I
think?) so DIMing them doesn't take up memory to store that they exist.
GH% however is simply an integer (exactly the same as if you did gh%)
and so BASIC has to allocate memory for its name and value.
-- Richard