kidwiththereplaceablehead wrote:
dammit they came so close to the perfect computer language but then they had to go and spoil it all by doing something stupid like the .net framework! i hate it oop and basic need to come together but not like that why can't they use vb for the gui and syntax and c++ for the components and as for counting from zero thats just stupid why can't c++ just count from 1 dammit!
I'm sorry, but if you don't understand why arrays, etc start at element zero, you are never going to be much of a programmer.
I suggest you stick with a version of Basic that doesn't start at zero (there aren't that many left).
As an aside, I'm guilty of supporting/extending a version of Basic where you could subscript a string to extract its characters (as strings themselves, of length one). Those subscripts started at one. Subscripting a string with index 0 gave the string length (as an integer). What was more fun was that it allowed slicing, so you could extract a sequence of characters just by subscripting with a range. The fiddling about involved to make all that work was really quite painful at times (particularly when extracting the null string from either end of the string).
E.g. if a$ contained "xyz", then...
a$(0) or a$(0 TO 0): 3
a$ or a$(1 TO 3): "xyz"
a$(1 TO 2): "xy", a$(2 TO 3): "yz"
a$(1) or a$(1 TO 1): "x", a$(2) or a$(2 TO 2): "y", a$(3) or a$(3 TO 3): "z"
a$(1 TO 0) or a$(2 TO 1) or a$(3 TO 2) or a$(4 TO 3): ""
All other possibilities were reported as errors.
NB. This version of Basic started arrays at zero, but also included the upper value when they were dimensioned - so "DIM a(10,10)" was 121 elements. Sort of "best of both worlds".
_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports."
Kamran Nazeer