Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Most oldschool BASIC dialects (including the original Dartmouth IIRC) use 0-based indices, though. It's the worst of both worlds, where something like:

  DIM a(10)
actually declares an array of 11 elements, with indices from 0 to 10 inclusive.

I believe it was QBASIC that first borrowed the ability to define ranges explicitly from Pascal, so that we could do:

  DIM a(1 TO 10)
etc to avoid the "zero element tax"


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: