[TUHS] Array index history

Ron Natalie ron at ronnatalie.com
Sat Jun 10 02:30:11 AEST 2017


I stand corrected.   I pulled up the original typewritten Dartmouth BASIC manual and indeed the indices start at zero (though many coding examples don't write the zeroth element).   By default arrays were 11 elements long.   You could change that with the DIM statement.   Yes, the value given to DIM is the highest index making a DIM A(20) defining a 21 element array.

-----Original Message-----
From: TUHS [mailto:tuhs-bounces at minnie.tuhs.org] On Behalf Of Random832
Sent: Friday, June 9, 2017 11:12 AM
To: tuhs at minnie.tuhs.org
Subject: Re: [TUHS] Array index history

On Thu, Jun 8, 2017, at 19:41, Steve Nickolas wrote:
> On Thu, 8 Jun 2017, Ron Natalie wrote:
> > DIM X(10) gave you ten elements from 1...10
> 
> All M$ dialects that I am aware of start at 0 by default.

In fact, they give you eleven elements from 0 to 10, which means that code which *uses* 1..10 is compatible but wastes some space.




More information about the TUHS mailing list