I hope it doesn't! The statements which are (precisely) equivalent are:
Code: Select all
DIM p% -1 : REM Set p% to end of heap
p% = END : REM Set p% to end of heap
Code: Select all
DIM p%% -1 : REM Set p%% to end of heap
p%% = END : REM Set p%% to end of heap
I don't know what you mean by "some zeros are worth more than others". It's easy to see how much memory is 'reserved' by repeating the operation:but I don't think that can be true, because the DIM statement actually reserves some memory.
Note the statement, "The amount of memory reserved is one byte greater than the value specified. DIM p%% −1 is a special case; it reserves zero bytes of memory." In other words, it reserves -1 bytes +1 byte, which is indeed zero but I suspect that some zeros are worth more than others.
Code: Select all
DIM p%% -1 : PRINT END
DIM p%% -1 : PRINT END
DIM p%% -1 : PRINT END
DIM p%% -1 : PRINT END
DIM p%% -1 : PRINT END
The easiest (but not necessarily the fastest) way to remove trailing spaces in BBC BASIC is as follows:Surely if all you want to do is remove trailing spaces, something like this would solve your problem?
Code: Select all
DEFFNtrim(a$):LOCALl% l%=LENa$ REPEAT:l%-=1:UNTILMID$(a$,l%,1)>" " =LEFT$(a$,l%)
Code: Select all
WHILE RIGHT$(a$) = " " : a$ = LEFT$(a$) : ENDWHILE