[TUHS] Array index history
Toby Thain
toby at telegraphics.com.au
Fri Jun 9 11:19:16 AEST 2017
On 2017-06-08 8:25 PM, Pete Turnbull wrote:
> On 09/06/2017 00:16, Ron Natalie wrote:
>>
>>> FORTRAN, yes. BASIC (which dialect might we be talking about?) normally
>> actually start with 0. However, BASIC is weird, in that the DIM
>> statement is
>> actually specifying the highest usable index, and not the size of the
>> array.
>>
>> Eh? Not in any BASIC I ever used. They all started at 1. Can't vouch
>> for the later Microsoft "visual" variants but the original 1970's era
>> BASIC
>> started with 1.
>> DIM X(10) gave you ten elements from 1...10
>
> Well, my experience matches Johnny's. I used many derivatives of
> MicroSoft BASIC - PET, Apple INTBASIC, Applesoft, Exidy Sorcerer, and
> others - and they all start at 0. AFAIR HP BASIC did so as well. The
> original 1960s Dartmouth BASIC (for which I have a copy of the manual)
> also started at 0 (cf. page 38); indeed if you didn't explicitly DIM an
> array, you got eleven elements indexed 0...10.
>
I wrote a lot of BBC BASIC. DIM(9) allocates ten elements, 0..9,
according to this:
http://www.riscos.com/support/developers/bbcbasic/part2/arrays.html
--Toby
More information about the TUHS
mailing list