Counting problem

Jacques Hausser jacques.hausser at unil.ch
Sat May 25 12:48:33 EDT 2013


Perhaps even stranger:

if you start for example with

put "a,b,c,d,e,f,g,h,i,j" into temp
put 0 into tcount
delete variable tcount
repeat 10
   add 1 to tcount[any item of temp]
end repeat

the loop works fine, even if the variable tcount was not defined as an array and was deleted before the loop…

Jacques



Le 25 mai 2013 à 18:30, Peter Haworth <pete at lcsql.com> a écrit :

> On Sat, May 25, 2013 at 8:41 AM, Dar Scott <dsc at swcp.com> wrote:
> 
>> Putting
>> 
>>        local tcount
>> 
>> at the top of the handler fixes this for me.  (Maybe somebody already said
>> that.)
>> 
>> This is a scary bug for me.  I quit LiveCode after the tests.
>> 
> 
> Hi Dar,
> I just posted that earlier this morning but it caught in the dreaded
> "message too big" trap - I sure wish that limit would be increased.
> 
> Anyway, the gist of my post was that I included local declarations for temp
> and counter because I use strict compilation mode and everything worked
> fine for me right from the start.  I switched strict compilation mode off
> and removed the local and the problem raised it's ugly head immediately.
> 
> It seems that the pre-allocation of memory works differently than the
> allocation of memory on the fly, which is somewhat scary.
> 
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list