[TUHS] Array index history
Pete Turnbull
pete at dunnington.plus.com
Fri Jun 9 10:25:04 AEST 2017
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.
--
Pete
Pete Turnbull
More information about the TUHS
mailing list