Problem with "Send" and "Dispatch"

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5277
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Problem with "Send" and "Dispatch"

Post by dunbarx » Fri Apr 13, 2018 12:24 am

I have a button handler that reads text from a file and loads data into a field on the same card. Works fine.

A little farther along that same handler, just before it ends in fact, I have a line that sends (with the "send" command) a message to that field. A handler in the field is set to catch that message, and do its thing.

About half the time it does not work. The message is not trapped. Same with "dispatch".

But if I duplicate the "send" line, it works about 80% of the time. And if I duplicate the "dispatch" line, it works ALL the time. And by "duplicate", I mean:

Code: Select all

...
dispatch "processData" to fld "printField" with "reload Fixture"
dispatch "processData" to fld "printField" with "reload Fixture"
... 
I am back in business with my two lines. Very happy.

Ready, set, go.

Why not just "go"?

Craig Newman

bogs
Posts: 1725
Joined: Sat Feb 25, 2017 10:45 pm

Re: Problem with "Send" and "Dispatch"

Post by bogs » Fri Apr 13, 2018 1:13 am

That is curious. Wonder if you used call from the field end if it would work more often.

*Edit - not saying that the others shouldn't work 100% of the time, though.
Image

Post Reply

Return to “Talking LiveCode”