Help: Id's can be completly unreliable
Bob Sneidar
bobs at twft.com
Wed Nov 10 18:42:59 EST 2010
Also I'd like to chip in here with another of my famous shots in the dark. If you have any handlers that intercept things like newCard or newButton and you don't pass the event in your handler, that could cause some problems as well, don't you think? Since no one else seems to be seeing this, I'd create a simple stack from scratch, and then try to reproduce the problem reliably.
Bob
On Nov 10, 2010, at 3:30 PM, Richard Gaskin wrote:
> Claudi Cornaz wrote:
>
>> Referencing a control with a ID 0 and using ID's to reference this
>> control might result in a error (control doesn't exist)
>> but not always. It depends on what you do.
>> Programaticly putting some text in a field with ID 0 (referencing the
>> control with the long id) didn't generate
>> a error but it also didn't put the text in the field, for instance.
>> Same with properties, no error, but also the propertie didn't get set.
>> This makes using ID's not reliable.
>>
>> So to be save, I don't use ID's anymore. It might go well a hundred
>> times but suddenly you might get an error.
>> Sometimes I get 8 out of 10 times a ID of 0 when copying a grp.
>> This also means the it variable might hold a invalid reference to the
>> newly created grp after copying, so you can't use it reliably
>> and you have to use the work around to reference the newly created grp.
>>
>> This problem with the ID of 0 has happened in different stacks and
>> with different kinds of grp's.
>> It drove me quite nuts for a while, as the IDE/engine gave sometimes a
>> error, but not always. This made it difficult to
>> find what's was going on.
>
> Thanks for the background on that.
>
> If you have a recipe for that please submit a bug report, but to be honest I've never seen anything like that in 12 years of working with this engine.
>
> IDs normally begin at 1001 and increment from there for every object added to the stack.
>
> Given how many people use the DataGrid, which copies groups many times during its operation, I suspect this bug is not easy to reproduce or we'd be seeing reports of DG failures.
>
> --
> Richard Gaskin
> Fourth World
> LiveCode training and consulting: http://www.fourthworld.com
> Webzine for LiveCode developers: http://www.LiveCodeJournal.com
> LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list