Re: General error function? (was Re: Should "dispatch" be extended for timers?)

2014-09-29 Thread Bob Sneidar
Doesn’t Applescript have an On Error function handler? I was looking for something of this sort when I first began working with Revolution and of course was directed to try/catch, but having an on error function, and then being able to turn off debugging would be a cleaner way of doing it. This

Re: Should "dispatch" be extended for timers?

2014-08-30 Thread Thierry Douez
>>> >>> As usual, lots of ways to achieve the same thing, thanks everyone. >>> >>> Pete >> >> Jacqueline's solution is more elegant than mine. > > > I can't take credit, I got it from the LC dictionary. :) In the "value" > entry, my method and yours are both discussed. So, there are some interest

Re: Should "dispatch" be extended for timers?

2014-08-30 Thread J. Landman Gay
On 8/30/2014, 2:17 AM, Thierry Douez wrote: As usual, lots of ways to achieve the same thing, thanks everyone. Pete Jacqueline's solution is more elegant than mine. I can't take credit, I got it from the LC dictionary. :) In the "value" entry, my method and yours are both discussed. -- Ja

Re: Should "dispatch" be extended for timers?

2014-08-30 Thread Thierry Douez
> As usual, lots of ways to achieve the same thing, thanks everyone. > > Pete Jacqueline's solution is more elegant than mine. Mine is more a trick or workaround :) Both work well. and is there some milliseconds-savy hunters somewhere to test which is the fastest? Regards, Thierry --

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread Peter Haworth
As usual, lots of ways to achieve the same thing, thanks everyone. Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin On Fri, Aug 29, 2014 at 11:28 AM, J. Landman Gay wrote: > On 8

Re: General error function? (was Re: Should "dispatch" be extended for timers?)

2014-08-29 Thread dunbarx
There is a reason Richard Gaskin was promoted to LC ombudsman. This is as useful and powerful as the "messageMessage". Craig -Original Message- From: Richard Gaskin To: use-livecode Sent: Fri, Aug 29, 2014 12:29 pm Subject: General error function? (was Re: Should &qu

Re: General error function? (was Re: Should "dispatch" be extended for timers?)

2014-08-29 Thread Peter Haworth
On Fri, Aug 29, 2014 at 9:28 AM, Richard Gaskin wrote: > And given that Open Language is just around the corner, wouldn't it seem > this is the best moment to clean up the mish-mash of inconsistent error > handling we have to deal with now? Absolutely! I'd extend that to the multiple ways SQL

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread J. Landman Gay
On 8/29/2014, 12:52 PM, Peter M. Brigham wrote: I thought you could use if for functions too, but as I just experimented with it, I can't get that to work. Like this: get value("myFunction(param)",cd "otherCard") The second parameter is the location of the function, which can be anywhere in

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread Peter M. Brigham
On Aug 29, 2014, at 11:43 AM, Peter Haworth wrote: > One other question regarding send. You can "dispatch function" - is there > a way to send a message to a function and get hold of the result (obviously > without a time specified)? Look at the "call" command. This works for commands contained

General error function? (was Re: Should "dispatch" be extended for timers?)

2014-08-29 Thread Richard Gaskin
Thierry Douez wrote: A small trick: send "want_the_return_value" to me put the result on want_the_return_value return 42 end want_the_return_value This raises another question: Should we have a general error function? Right now "the result" sometimes contains data, but sometimes

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread Peter Haworth
Thank you Thierry! Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin On Fri, Aug 29, 2014 at 8:57 AM, Thierry Douez wrote: > > > > One other question regarding send. You can "dis

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread Richard Gaskin
Trevor wrote: I don't know if there is a reason dispatch doesn't have timers, but what if "send" was just updated to support "with"? If "with" was present then we could do this: send "someCommand" to someObject with param1, param2 in 10 milliseconds The thing is, dispatch is useful if A) you w

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread Thierry Douez
> > One other question regarding send. You can "dispatch function" - is there > a way to send a message to a function and get hold of the result (obviously > without a time specified)? > > Pete A small trick: send "want_the_return_value" to me put the result on want_the_return_value

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread Peter Haworth
On Fri, Aug 29, 2014 at 5:58 AM, Trevor DeVore wrote: > Given how dispatch works, I see 'send is' as being what you use if you want > to execute some code after the current event loop has finished executing. > The downside is that the syntax stinks. But if the syntax were updated so > that it sup

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread Devin Asay
On Aug 29, 2014, at 6:58 AM, Trevor DeVore wrote: > On Tue, Aug 26, 2014 at 10:09 PM, Richard Gaskin > wrote: > >> >> Is there some reason I've overlooked as to why "send" allows timers but >> "dispatch" doesn't? > > > I don't know if there is a reason dispatch doesn't have timers, but what

Re: Should "dispatch" be extended for timers?

2014-08-29 Thread Trevor DeVore
On Tue, Aug 26, 2014 at 10:09 PM, Richard Gaskin wrote: > > Is there some reason I've overlooked as to why "send" allows timers but > "dispatch" doesn't? I don't know if there is a reason dispatch doesn't have timers, but what if "send" was just updated to support "with"? If "with" was present

Re: Should "dispatch" be extended for timers?

2014-08-27 Thread Michael Doub
Peter, Thanks for setting me straight This means that send with no time specified and dispatch behave exactly the same behavior as a hander or function call, where the currently executing entry is push on to the stack and sent or dispatched item is put on top and is executed. This makes sens

RE: Should "dispatch" be extended for timers?

2014-08-27 Thread Paul D. DeRocco
> From: Peter Haworth > > I think send works the same way if it has no time specified. > According to > the dictionary, a send with no time executes the "sent" handler > immediately, then execution of the current handler continues. > With a send > in time, the current handler finishes executing

Re: Should "dispatch" be extended for timers?

2014-08-27 Thread Peter Haworth
On Wed, Aug 27, 2014 at 10:42 AM, Michael Doub wrote: > The send with no time specified and dispatch, both inserts the called > hander, just below the top entry on the stack to it will be the next to > execute when the current top entry is finished. I might be misunderstanding your explanation

Re: Should "dispatch" be extended for timers?

2014-08-27 Thread Richard Gaskin
William Prothero wrote: > I've wondered what, specifically, "blocking" means. Does it mean that > there are no idle messages sent? What is being blocked? Given this: on mouseUp DoSomething send "DoSomethingElse" to me DoSomeOtherThing end mouseUp on DoSomethingElse put 1+1 into gSom

Re: Should "dispatch" be extended for timers?

2014-08-27 Thread Michael Doub
t;> end mouseUp >>> >>> >>> on MouseUp >>> send "doSomething" to this card >>> end mouseUp >>> >>> >>> Can you explain the difference? >>> >>> >>> Craig >>> >>>

Re: Should "dispatch" be extended for timers?

2014-08-27 Thread Earthednet-wp
seUp >> >> >> on MouseUp >> send "doSomething" to this card >> end mouseUp >> >> >> Can you explain the difference? >> >> >> Craig >> >> >> >> -Original Message- >> From: Richard Gaski

Re: Should "dispatch" be extended for timers?

2014-08-27 Thread Bob Sneidar
this card > end mouseUp > > > Can you explain the difference? > > > Craig > > > > -Original Message- > From: Richard Gaskin > To: use-livecode > Sent: Wed, Aug 27, 2014 10:18 am > Subject: Re: Should "dispatch" be extended for t

Re: Should "dispatch" be extended for timers?

2014-08-27 Thread dunbarx
Original Message- From: Richard Gaskin To: use-livecode Sent: Wed, Aug 27, 2014 10:18 am Subject: Re: Should "dispatch" be extended for timers? Peter Haworth wrote: > Sounds like a great idea to me. I seem to remember that one of > dispatch/send is blocking and the othe

Re: Should "dispatch" be extended for timers?

2014-08-27 Thread Richard Gaskin
Peter Haworth wrote: > Sounds like a great idea to me. I seem to remember that one of > dispatch/send is blocking and the other isn't. Could that be a > possible reason for the lack of "in" with dispatch? Both are blocking when called immediately; "send" can become on-blocking by specifying a

Re: Should "dispatch" be extended for timers?

2014-08-26 Thread dunbarx
end putArg Craig -Original Message----- From: Richard Gaskin To: How to use LiveCode Sent: Tue, Aug 26, 2014 10:09 pm Subject: Should "dispatch" be extended for timers? I love "dispatch", and the more I use it the more I find "send" murky. With "d

Re: Should "dispatch" be extended for timers?

2014-08-26 Thread Peter Haworth
Sounds like a great idea to me. I seem to remember that one of dispatch/send is blocking and the other isn't. Could that be a possible reason for the lack of "in" with dispatch? Pete lcSQL Software On Aug 26, 2014 7:09 PM, "Richard Gaskin" wrote: > I love "dispatch", and the more I use it the m

Re: Should "dispatch" be extended for timers?

2014-08-26 Thread Scott Rossi
Sounds like a good idea. If dispatch is already fast, a timer would just allow you to slow it down. BTW, I believe using quotes should make your message "send"-able. send "clearVideo LayerAlpha, baseLayer, LayerGraphic, LayerAudio" to me in 700 milliseconds Regards, Scott Rossi Creative Direc

Should "dispatch" be extended for timers?

2014-08-26 Thread Richard Gaskin
I love "dispatch", and the more I use it the more I find "send" murky. With "dispatch" params seem more natural to me: dispatch "somecommand" to tSomeObj with tArg2, tArg2 But with "send" it's less clear how params are handled - here's an example from the forums today: send clearVideo L