|
Post by votan on Aug 14, 2008 5:21:16 GMT -5
Well, this is not a real error, but still something that is very anoying when needed..... I can only set 10 indexes for one string... so like for i = 1 to 40 a$(i) = str$(i) print a$(i) next i will result in as RB only allows 10 indexes per string... Is there a way to raise this number, or is there a special reason why the limit is that low?
|
|
|
Post by Psycho on Aug 14, 2008 5:50:37 GMT -5
Votan, I think you just need to dim the array first. RB limits you to 10 on an array unless you further dim it for your needs.
dim a$(40) for i = 1 to 40 a$(i) = str$(i) print a$(i) next i
Psycho
|
|
|
Post by StefanPendl on Aug 14, 2008 7:10:52 GMT -5
Is there a way to raise this number, or is there a special reason why the limit is that low? The default size of an array is 11 elements (0 - 10) for each dimension. If you need more than that, you will have to size the array before its usage. dim array(255) dim test(255,255) dim hurray(255,255,255) In general it is always best to size the array before its usage, if it is less than the default 11 elements you will get less memory usage.
|
|
|
Post by votan on Aug 14, 2008 8:52:50 GMT -5
Argh, lol .... well, that happens if you don't read the instruction well. My fault! Thanks a lot!
|
|
|
Post by Carl Gundel - admin on Aug 14, 2008 8:53:42 GMT -5
This is the way that BASIC traditionally works, not just RB. -Carl Well, this is not a real error, but still something that is very anoying when needed..... I can only set 10 indexes for one string... so like for i = 1 to 40 a$(i) = str$(i) print a$(i) next i will result in as RB only allows 10 indexes per string... Is there a way to raise this number, or is there a special reason why the limit is that low?
|
|