From mboxrd@z Thu Jan 1 00:00:00 1970 From: toby@telegraphics.com.au (Toby Thain) Date: Thu, 8 Jun 2017 21:19:16 -0400 Subject: [TUHS] Array index history In-Reply-To: References: <026801d2e0ad$4e13cc10$ea3b6430$@ronnatalie.com> Message-ID: <1b557724-cbd5-8602-3b75-5e68df9e7a3f@telegraphics.com.au> 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