GLBasic forum

Main forum => Bug Reports => Topic started by: kanonet on 2013-Jan-18

Title: V11: REDIM + FOREACH
Post by: kanonet on 2013-Jan-18
If you use REDIM
Title: Re: V11: REDIM + FOREACH
Post by: MrTAToad on 2013-Jan-18
Quite true - obviously that is an internal count...
Title: V11: REDIM + FOREACH
Post by: Kitty Hello on 2013-Jan-20
Oh. If that's true its a good find. These things cause really trouble.
Title: Re: V11: REDIM + FOREACH
Post by: Hemlos on 2013-Jan-21
Interesting, didnt know there was a DOT count feature.
Is this intended to be quicker than LEN and BOUNDS?
Title: Re: V11: REDIM + FOREACH
Post by: kanonet on 2013-Jan-21
Array.count is no official GLB feature/syntax, its a 'hack' that uses GLB intern C transformation. It is faster than LEN/BOUNDS, but I dont know if its save (and if it will be in the future), but I use it quite some time without problems (and since it is used in FOREACH intern, it should be no problem to use it). Obviously it just works with integers, floats and strings, but not with types (I have no idea, how to do this with types...). If you want to do it on a String array, LEN(array$[]) turns into array_Str.count.
Btw. I was always thinking about creating a thread where we could collect all the cool 'hacks' and workarounds, that make life easier...

I posted it here just cause I already tracked down the error to this counter, so Gernot just needs to do a shorter search on his own.
Title: Re: V11: REDIM + FOREACH
Post by: hardyx on 2013-May-21
It's not a new bug. Doesn't work in 10.283 version either.