Page 1 of 1
subscript out of range
Posted: Thu Jan 19, 2006 10:16 pm
by shibby
OK, i got a question. What does subscript out of range mean?
Arrays
Posted: Fri Jan 20, 2006 12:55 pm
by Zim
It means you have an array and it has a certain dimension (the maximum number of elements in the array) and something in your program is trying to use or assign an element beyond or larger than that. For example:
would generate such an error.
Sometimes a misplaced parenthesis "(" in a program can make BASIC think you're refering to an array when you never intended to, thus causing an array subscript error.
Also, in BASIC you can refer to the first 10 elements of an array without actually using DIM first, but that's not good programming practice.
Re: Arrays
Posted: Fri Jan 20, 2006 3:14 pm
by moneo
[quote="Zim"].....
For example:
would generate such an error.
Ooops, I'm sure you meant:
*****