script works only during debugging

Nicolas Cueto niconiko at gmail.com
Thu May 10 20:01:29 EDT 2012


Solved it!

It seems the problem was related to "send in 0 milliseconds". In
essence, HANDLER 1 before exiting would call HANDLER 2, and then
HANDLER 2 would before exiting do two "send in 0 milliseconds" to
HANDLERS 3 & 4.

During debugging, when I inserted a "wait 50 milliseconds with
messages" at the end of HANDLER 2, the script worked.

So, I then tried it without the "wait" after first replacing the "send
in 0 milliseconds" with explicit calls to HANDLERS 3 & 4 within
HANDLER 2. That worked too.



The LC doc's entry for "send" states:

"If you use the send in time form of the send command--even if you
specify a time of zero seconds--the current handler finishes executing
before the message is sent."

Am I wrong to understand that, in my situation described above, the
"current handler" would be HANDLER 2? And, if there's 2 "send in 0"
statements, in what order do they get triggered?


Very relieved to be done with this problem!

Cheers.
--
Nicolas Cueto



On Fri, May 11, 2012 at 7:13 AM, Peter Haworth <pete at lcsql.com> wrote:
> It's on the same card.
> Pete
> lcSQL Software <http://www.lcsql.com>
>
>
>
> On Thu, May 10, 2012 at 2:36 PM, Bob Sneidar <bobs at twft.com> wrote:
>
>> Hmmm... I seem to recall a similar issue. If you are not on the card that
>> contains the "abc" button, then LC will not know about it yet. Try changing
>> your script to refer to the button as button "abc" of card "<thecardname>"
>> and see what happens.
>>
>> Bob
>>
>>
>> On May 10, 2012, at 12:37 PM, Mark Wieder wrote:
>>
>> > Peter Haworth <pete at ...> writes:
>> >
>> >>
>> >> Well, there is one thing worse that that - somethig that works in the
>> IDE
>> >> but not in a standalone.
>> >
>> > PowerDebug is the only way to debug running standalones interactively.
>> >
>> >> I have a situationlike that right now where a simple "send mouseUp to
>> >> button "abc" where the sender is on the same card as button "abc".
>>  Works
>> >> fine in the IDE but fails in a standalone, with the error message "Hint"
>> >> being the button "abc".
>> >
>> > Could there be an error in the mouseUp handler in the button? What's the
>> error
>> > code number? The button is named "abc" without spaces or quotes? Can you
>> tell if
>> > it's the send command or the mouseUp handler that's at fault?
>> >
>> > --
>> > Mark Wieder
>> >
>> >
>> >
>> > _______________________________________________
>> > 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
>>
>>
>> _______________________________________________
>> 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
>>
> _______________________________________________
> 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