Posted: 05:37pm 10 Feb 2016 |
Copy link to clipboard |
 Print this post |
|
Hi all,
Can someone tell me why defining a string with more than n characters does not generate an error (page 55 of the MM manual indicates it should.).
See my example below :-
Using an MM with 5.1 loaded.
> dim t$(3) as string length 3
> t$(0) = "abc"
> t$(1) = "def"
> t$(2) = "ghi"
> t$(3) = "jkl"
> for i = 0 to 3 : ? t$(i) : next
abc
def
ghi
jkl
> t$(2) = "mnopq"
> for i = 0 to 3 : ? t$(i) : next
abc
def
mnopq
jkl
> t$(4) = "xyz"
Error: Array index out of bounds
>
As you can see referencing an out of bounds element does cause an error (as expected). Rob White |