Re: Wait with messages
All , Problem was solved by INCREASING the wait with milliseconds ?! Worse with wait 0 milliseconds Original wait was 1 millisecond Works like lightening with 5 Milliseconds , Now I can press a button on any card and exit the loop instantly. Regards Camm - Original Message - From: Mark Schonewille [EMAIL PROTECTED] To: How to use Revolution use-revolution@lists.runrev.com Sent: Saturday, February 23, 2008 6:09 PM Subject: Re: Wait with messages Oh... Camm, not Curry, so sorry for that. It is really friendly of you to thank me(?) in advance, but do you have any more questions or are you going to try to change your repeat loop now? I don't get what you want to say by I thought if not checking for x after each function in the loop it would mean 10 x 250ms wait to exit Why would it mean 2500ms wait to exit and what is it? Of course, if you put a wait statement in your repeat loop, like wait for 250 millisecs with messages it will delay for 250 millics, but if you look at my example, you'll see that waiting with 0 millisecs is sufficient, i.e. no delay unless other messages are being sent (such as mouseUp). Best regards, Mark Schonewille -- Economy-x-Talk Consulting and Software Engineering http://economy-x-talk.com http://www.salery.biz Convert colours between different colour spaces with Color Converter. Download at http://economy-x-talk.com/cc.html Op 23-feb-2008, om 18:31 heeft Camm29 het volgende geschreven: Thanks for that , 1 is put into x within a button script on mouseup . Why do i check (x=1) 2 times ? Well I actually check for(x=1) 10 times ?! I think I've missed the concept of messages I thought if not checking for x after each function in the loop it would mean 10 x 250ms wait to exit Each do something (10 off ) in the loop retrieves different data (each takes 250ms) via the rs232 port and displays on a card in real time until the stop button is pressed. Thanks in advance Camm - Original Message - From: Mark Schonewille [EMAIL PROTECTED] To: How to use Revolution use-revolution@lists.runrev.com Sent: Friday, February 22, 2008 1:37 PM Subject: Re: Wait with messages Hi Curry, There might be a problem caused by the fact that the script is currently running, but since I don't see how you change x, I am not sure about this. Usually, I use a custom property or the hilite of a button rather than a variable (which in your case seems to be set and read in the same script). Also, I can imagine that waiting with messages halfway the repeat loop doesn't work perfectly. I always put the wait statement at the end of the loop. Also, the repeat loop itself doesn't run with messages. What always works for me is: repeat forever with messages -- I rarely use forever btw if someCondition then -- do something else exit repeat wait 0 millisecs with messages end repeat You might need to re-think the design of your repeat loop. Why do you need to check x two times? Is it possible for the user to determine whether s/he will click before the first or the second wait statement? Best regards, Mark Schonewille -- Economy-x-Talk Consulting and Software Engineering http://economy-x-talk.com http://www.salery.biz Convert colours between different colour spaces with Color Converter. Download at http://economy-x-talk.com/cc.html ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.8/1288 - Release Date: 19/02/2008 20:47 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Wait with messages
Thanks for that , 1 is put into x within a button script on mouseup . Why do i check (x=1) 2 times ? Well I actually check for(x=1) 10 times ?! I think I've missed the concept of messages I thought if not checking for x after each function in the loop it would mean 10 x 250ms wait to exit Each do something (10 off ) in the loop retrieves different data (each takes 250ms) via the rs232 port and displays on a card in real time until the stop button is pressed. Thanks in advance Camm - Original Message - From: Mark Schonewille [EMAIL PROTECTED] To: How to use Revolution use-revolution@lists.runrev.com Sent: Friday, February 22, 2008 1:37 PM Subject: Re: Wait with messages Hi Curry, There might be a problem caused by the fact that the script is currently running, but since I don't see how you change x, I am not sure about this. Usually, I use a custom property or the hilite of a button rather than a variable (which in your case seems to be set and read in the same script). Also, I can imagine that waiting with messages halfway the repeat loop doesn't work perfectly. I always put the wait statement at the end of the loop. Also, the repeat loop itself doesn't run with messages. What always works for me is: repeat forever with messages -- I rarely use forever btw if someCondition then -- do something else exit repeat wait 0 millisecs with messages end repeat You might need to re-think the design of your repeat loop. Why do you need to check x two times? Is it possible for the user to determine whether s/he will click before the first or the second wait statement? Best regards, Mark Schonewille -- Economy-x-Talk Consulting and Software Engineering http://economy-x-talk.com http://www.salery.biz Convert colours between different colour spaces with Color Converter. Download at http://economy-x-talk.com/cc.html Op 22-feb-2008, om 14:24 heeft [EMAIL PROTECTED] [EMAIL PROTECTED] het volgende geschreven: I have a loop with :- repeat . do something (takes about 250ms) wait 1 millisecond with messages if x=1 then exit repeat . do something (takes about 250ms) wait 1 millisecond with messages if x=1 then exit repeat end repeat I have a button that makes x =1 to exit 1 card and go to another The seems to be a larger delay than i expected to exit the repeat 2-5 secs Any ideas how to exit repeat very fast ??? Thanks in advance ! ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.516 / Virus Database: 269.20.8/1288 - Release Date: 19/02/2008 20:47 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Wait with messages
Oh... Camm, not Curry, so sorry for that. It is really friendly of you to thank me(?) in advance, but do you have any more questions or are you going to try to change your repeat loop now? I don't get what you want to say by I thought if not checking for x after each function in the loop it would mean 10 x 250ms wait to exit Why would it mean 2500ms wait to exit and what is it? Of course, if you put a wait statement in your repeat loop, like wait for 250 millisecs with messages it will delay for 250 millics, but if you look at my example, you'll see that waiting with 0 millisecs is sufficient, i.e. no delay unless other messages are being sent (such as mouseUp). Best regards, Mark Schonewille -- Economy-x-Talk Consulting and Software Engineering http://economy-x-talk.com http://www.salery.biz Convert colours between different colour spaces with Color Converter. Download at http://economy-x-talk.com/cc.html Op 23-feb-2008, om 18:31 heeft Camm29 het volgende geschreven: Thanks for that , 1 is put into x within a button script on mouseup . Why do i check (x=1) 2 times ? Well I actually check for(x=1) 10 times ?! I think I've missed the concept of messages I thought if not checking for x after each function in the loop it would mean 10 x 250ms wait to exit Each do something (10 off ) in the loop retrieves different data (each takes 250ms) via the rs232 port and displays on a card in real time until the stop button is pressed. Thanks in advance Camm - Original Message - From: Mark Schonewille [EMAIL PROTECTED] To: How to use Revolution use-revolution@lists.runrev.com Sent: Friday, February 22, 2008 1:37 PM Subject: Re: Wait with messages Hi Curry, There might be a problem caused by the fact that the script is currently running, but since I don't see how you change x, I am not sure about this. Usually, I use a custom property or the hilite of a button rather than a variable (which in your case seems to be set and read in the same script). Also, I can imagine that waiting with messages halfway the repeat loop doesn't work perfectly. I always put the wait statement at the end of the loop. Also, the repeat loop itself doesn't run with messages. What always works for me is: repeat forever with messages -- I rarely use forever btw if someCondition then -- do something else exit repeat wait 0 millisecs with messages end repeat You might need to re-think the design of your repeat loop. Why do you need to check x two times? Is it possible for the user to determine whether s/he will click before the first or the second wait statement? Best regards, Mark Schonewille -- Economy-x-Talk Consulting and Software Engineering http://economy-x-talk.com http://www.salery.biz Convert colours between different colour spaces with Color Converter. Download at http://economy-x-talk.com/cc.html ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages revisited.
Did that to ensure the code would not be misunderstood. I have found that using that using if gblA then confused many newbie developers. I find quite easy to understand but I was attempting to code to the lowest denominator. -==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=- Disclaimer: Any resemblance between the above views and those of my employer, my terminal, or the view out my window are purely coincidental. Any resemblance between the above and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader. The question of the existence of the reader is left as an exercise for the second god coefficient. (A discussion of non-orthogonal, non-integral polytheism is beyond the scope of this article.) --- On Mon 11/01, Dar Scott [EMAIL PROTECTED] wrote: From: Dar Scott [mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Mon, 1 Nov 2004 14:59:58 -0700 Subject: Re: wait with messages revisited. brOn Nov 1, 2004, at 9:24 AM, K wrote:brbrif gblA is true then return truebrbrAre you actually doing this?brOr this?brbr if gblA then exit repeatbrbrDarbrbr Dar Scott Consultingbr http://www.swcp.com/dsc/br Programming Servicesbrbrbr___bruse-revolution mailing listbr[EMAIL PROTECTED]brhttp://lists.runrev.com/mailman/listinfo/use-revolutionbr ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages revisited.
I posted the below some days ago. I have further questions and further infomation. In my testing of wait for X seconds with message: Example code: global gblA global gblB [Button A] on mouseUp repeat forever put Waiting A return after field status if gblA is true then return true wait for 1 seconds with messages end repeat put A completed return after field status end mouseUp [Button SignalA] on mouseUp put Signaled A return into field status put true into gblA end mouseUp [Button SignalB] on mouseUp put Signaled B return into field status put true into gblB end mouseUp [Button B] on mouseUp repeat forever put Waiting B return after field status if gblB is true then return true wait for 1 seconds with messages end repeat put B Completed return after field status end mouseUp Event Output [Clicked A] Waiting A [Clicked B] Waiting B [Clicked SignalA] No output [Clicked SignalB] B completed A completed This is not the case on Win32 is different. How is this supposed to work? The documentation does not refer to any dependency for wait time with messages or even wait until x with messages. I am confused!!! Okay, some time ago everyone assisted me with understanding how wait with messages functions. I am still a bit confused. In my testing I found the following. Example code: [Button A] global evtA on mouseUp put Waiting on event (A) cr into field edtStatus wait until evtA with messages put Event (A) signaled cr into field edtStatus end mouseUp [Button B] global evtB on mouseUp put Waiting on event (B) cr into field edtStatus wait until evtB with messages put Event (B) signaled cr into field edtStatus end mouseUp [Button Clear] global evtA global evtB on mouseUp put false into evtA put false into evtB end mouseUp [Button SignalA] global evtA on mouseUp put true into evtA end mouseUp [Button SignalB] global evtB on mouseUp put true into evtB end mouseUp Test Click Clear Output: Nothing Click A Output: Waiting on event (A) Click B Output: Waiting on event (B) Click SignalA Output: Nothing Click SignalB Output: Waiting on event (A) Output: Waiting on event (B) This means that each wait is dependent on the previous A cannot be signaled until B completes. Is this the intended result? ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages revisited.
On Nov 1, 2004, at 9:24 AM, K wrote: if gblA is true then return true Are you actually doing this? Or this? if gblA then exit repeat Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages
--- Dar Scott [EMAIL PROTECTED] wrote: On Aug 12, 2004, at 6:16 PM, Erik Hansen wrote: if you had your website URL as part of your signoff then it would be easier to find your stacks! Like this? Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services yeah! now i can go to the shop and download that messages stack. Erik Hansen = [EMAIL PROTECTED]http://www.erikhansen.org __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages
if you had your website URL as part of your signoff then it would be easier to find your stacks! Thanks for the advice, Erik Hansen = [EMAIL PROTECTED]http://www.erikhansen.org __ Do you Yahoo!? Yahoo! Mail is new and improved - Check it out! http://promotions.yahoo.com/new_mail ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages
On Aug 12, 2004, at 6:16 PM, Erik Hansen wrote: if you had your website URL as part of your signoff then it would be easier to find your stacks! Like this? Dar Dar Scott Consulting http://www.swcp.com/dsc/ Programming Services ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages
On Aug 10, 2004, at 2:06 PM, K wrote: I seems that when I execute a wait with messages for a specific contition and another event execute a wait with messages on a different condition the seconds wait cancels the first. In other mail: Task aka event '1' is executing code but needs to wait for a variable to be altered by a send in time task '2'. Task '2' also realizes it must wait on task '3' to alter a variable so it execute the wait with messages also. When task '2' executes this task '1' suddenly aborts or returns from it's wait (even though '2' has not made any modification to the variable. This seems to work for me in Rev 2.2 on OS X 10.3.4. I made this card script: local a local b on setA put true into a log a is set end setA on setB put true into b log b is set end setB on test put empty put false into a put false into b log variables are cleared log before wait for a wait until a with messages log after wait for a log all done end test on insideTest log before wait for b wait until b with messages log after wait for b end insideTest on log logText put the long time quote logText quote after message put a = a after message put ; b = b lf after message end log * I put on the card 4 buttons, one for each of commands setA, setB, test, and insideTest. I labeled them such and had the mouseUp call the corresponding one. On these button clicks in this order: test, insideTest, setA, setB ...I get this result: 10:11:24 AM variables are cleared a = false; b = false 10:11:24 AM before wait for a a = false; b = false 10:11:25 AM before wait for b a = false; b = false 10:11:27 AM a is set a = true; b = false 10:11:29 AM b is set a = true; b = true 10:11:29 AM after wait for b a = true; b = true 10:11:29 AM after wait for a a = true; b = true 10:11:29 AM all done a = true; b = true That looks right to me. I tried some variations and those look right. Note that because of the nesting, the wait for a is blocked by the wait for b. Looking at the time, you can see that once the setB button is clicked, everything wraps up. Dar Scott ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages
On Aug 11, 2004, at 9:55 AM, Dar Scott wrote: Without polling what is the best way to wait (while messages continue processing) for a viriable state to change? Since wait with messages is presenting several anomalies I cannot explain. One way would be to use a custom command (hander) to set the variable. It can 'send ... in 0'. A possible problem is that it might queue up several messages before execution completes and only one is needed. Another way is to call a routine to check what needs to be done at the end of routines and it can do the sends. By the way, polling may not be so bad if you don't need a fast response. Use a cycle like one of the flashers in the primer. Maybe you can poll every 100 or 200 ms or even faster. Look at the cpu meter if you are concerned. In the case of something like a FIFO, you might give the fifo a message to send whenever it becomes empty and a message to send every time it become nonempty. If you put a cycle in that to check the state and send the message, that is mostly a fallback and would not affect the normal performance. Dar Scott ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages
Thanks, I do believe now that my code is not working in the correct manner. Honestly, I would prefer it worked like the VB event system were you could just doEvents to yeild the tasker/system (KISS). I will rewrite the offending routines! Kevin -==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=- Disclaimer: Any resemblance between the above views and those of my employer, my terminal, or the view out my window are purely coincidental. Any resemblance between the above and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader. The question of the existence of the reader is left as an exercise for the second god coefficient. (A discussion of non-orthogonal, non-integral polytheism is beyond the scope of this article.) --- On Wed 08/11, Dar Scott [EMAIL PROTECTED] wrote: From: Dar Scott [mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Wed, 11 Aug 2004 10:29:34 -0600 Subject: Re: wait with messages brOn Aug 11, 2004, at 9:55 AM, Dar Scott wrote:brbr Without polling what is the best way to wait (while messages continue br processing) for a viriable state to change? Since wait with messages br is presenting several anomalies I cannot explain.brbr One way would be to use a custom command (hander) to set the variable. br It can 'send ... in 0'. A possible problem is that it might queue up br several messages before execution completes and only one is needed.brbr Another way is to call a routine to check what needs to be done at the br end of routines and it can do the sends.brbrBy the way, polling may not be so bad if you don't need a fast brresponse. Use a cycle like one of the flashers in the primer. Maybe bryou can poll every 100 or 200 ms or even faster. Look at the cpu meter brif you are concerned.brbrIn the case of something like a FIFO, you might give the fifo a message brto send whenever it becomes empty and a message to send every time it brbecome nonempty. If you put a cycle in that to check the state and brsend the message, that is mostly a fallback and would not affect the brnormal performance.brbrDar Scottbrbr___bruse-revolution mailing listbr[EMAIL PROTECTED]brhttp://lists.runrev.com/mailman/listinfo/use-revolutionbr ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: wait with messages
Sorry, I did not explaine the situation well enough. I seems that when I execute a wait with messages for a specific contition and another event execute a wait with messages on a different condition the seconds wait cancels the first. Kevin -==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=- Disclaimer: Any resemblance between the above views and those of my employer, my terminal, or the view out my window are purely coincidental. Any resemblance between the above and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader. The question of the existence of the reader is left as an exercise for the second god coefficient. (A discussion of non-orthogonal, non-integral polytheism is beyond the scope of this article.) --- On Tue 08/10, K [EMAIL PROTECTED] wrote: From: K [mailto: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Tue, 10 Aug 2004 16:01:39 -0400 (EDT) Subject: wait with messages brbrI cannot wait with messages on more than a single condition! I this the intended behavior? Why can't I wait on more than one condition? brbrKevinbrbrbrbrbr-==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=-brDisclaimer:brbrAny resemblance between the above views and those of mybremployer, my terminal, or the view out my window are purelybrcoincidental. brAny resemblance between the above and my own views is non-deterministic.brbr The question of the existence of views in the absence of anyone to holdbrthembris left as an exercise for the reader. The question of the existence ofbrthe readerbr is left as an exercise for the second god coefficient. br(A discussion of non-orthogonal, non-integral polytheism is beyond thebrscope of this article.)brbrbrbr___brJoin Excite! - http://www.excite.combrThe most personalized portal on the Web!br___ bruse-revolution mailing listbr[EMAIL PROTECTED]brhttp://lists.runrev.com/mailman/listinfo/use-revolutionbr ___ Join Excite! - http://www.excite.com The most personalized portal on the Web! ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages
On Aug 10, 2004, at 2:06 PM, K wrote: Sorry, I did not explaine the situation well enough. I seems that when I execute a wait with messages for a specific contition and another event execute a wait with messages on a different condition the seconds wait cancels the first. The waits will nest. You should use an event style of programming; the multi-threading style will not work. You can poll with a send-in-time cycle. Or you can use a setProp or other changing function, to send a message upon a change of some parameters or variables. The Primer on Message Mechanics might give you some ideas, too. Find it here: http://www.swcp.com/dsc/revstacks.html The basic idea of the event style is that each event (user action or I/O event or delayed message created with send) makes a change to the state of your program perhaps such that other user action or I/O events or delayed messages are destined to come, all creating the behavior you want. Dar Scott ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages
On Aug 11, 2004, at 1:12 AM, Richard Gaskin wrote: The Primer on Message Mechanics might give you some ideas, too. Find it here: http://www.swcp.com/dsc/revstacks.html That's a wonderful tutorial Dar. The animated message path simulation is great! Thanks for posting that. Yup. Should be required reading, and distributed with the Rev package. Not only is it remarkably helpful info, it has some great techniques in its presentation. Dar, it would be a great thing for the new RevOnline doohickey. -- Troy RPSystems, Ltd. http://www.rpsystems.net ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages...
Recently, Chipp Walters [EMAIL PROTECTED] wrote: Can you provide an example where you would use one and not the other or not 'send'? Chipp -- I didn't see too many other responses here so I'll chime in... One thing I recently started using wait with messages for is queuing a set of sounds for playback. I was a staunch advocate for using send in to monitor the status of media using all sorts of custom timers and what-not. But then it occurred to me that wait with messages should achieve the same result, and it seems to work great. As a simple example: on playQueue pList repeat with N = 1 to number of items of pList play audioClip N wait until the sound is done with messages wait 500 milliseconds with messages end repeat end playQueue The above handler will play a list of audioClips sent to it with a 1/2 second delay between each clip. Now playing audio by itself is not very overwhelming until you realize that the above repeat loop will run virtually asynchronously while other scripts are running: mouse tracking, button clicks, hiding/showing images, pretty much anything. Another way to use wait with messages is card or stack initialization for any set of events that take time to process (such as setting fileNames of players and starting playback). I've only just started getting into this technique but so far it involves less scripting and maintenance than send in and it virtually eliminates stray message loops winding up in the pendingMessages. My impression is that wait with messages is pretty much the same as send in but without control or access to the messages being sent by the engine. I'd like to see Scott Raney chime on this from a technical level to know what the real differences are, if any. Anyway, while some folks on the list may be put off by the lack of real external message threading, the internal threading within Rev is pretty phenomenal once you start to play around with it. Regards, Scott Rossi Creative Director Tactile Media, Development Design - E: [EMAIL PROTECTED] W: http://www.tactilemedia.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: wait with messages...
Thanks for the explanation. How would you use: wait for messages and wait with messages ?? Would it be something like: wait for 4 seconds with messages Right, allowing processing to continue while it waits. wait for messages (pauses handler until *any* message is received? and why would I ever use this?) I don't know... this one seems a little goofy, but I'm sure there was a reason to have it developed. :-) Another one I like is this one: global gStatus wait until gStatus is go with messages This allows you to stop at a line and wait until a global has been set to a particular value while other things are going on. GIH (glad it helps) Ken ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: wait with messages...
Regarding remote popups, I'd like to add the esoteric information that you need to use this wait with messages conditional in standalones that run under mac system 7 as well as windows. 68k standalones tested under emulation on a PPC don't need this, but when run under system 7 they behave the same as windows. There is another subtle platform difference I've found with remote popups, which is that if the traversalon of the remote popup button is true (the default), the resulting menu will grab the focus under windows (and mac system 7), but not on PPC mac. I'd guess this is a related isssue. Martin For example, one thing that has been bugged in Bugzilla is that opening up a popup menu remotely: popup (long id of btn ContextPop of card 1 of stack MyStack) at the mouseLoc is modal on MacOS (i.e. it waits until you pick something from the menu before it goes to the next script line), but on Windows, it's not (it pops up the menu and immediately goes to the next script line). So to get around it, I have added right after it: if the platform is Win32 then wait until the mouse is up with messages end if This causes the script to pause, but allows other things to happen (pendingMessages get sent, etc.). HTH, Ken Ray ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: wait with messages...
At 12:14 am -0600 1/2/04, Chipp Walters wrote: Would it be something like: wait for 4 seconds with messages I'm not sure if that will work. The old Metacard docs only show the with messages option being valid with the wait until or wait while variations of wait. I.e. it needs a condition. But the Rev docs shows it being OK with wait for as well. wait for messages (pauses handler until *any* message is received? and why would I ever use this?) I have a feeling there's some great power here, I just want to understand how to use it! This one puzzled me when I took over libUrl. It was full of snippets like this (and still is): repeat until condition wait for messages end repeat It seemed the same as this: wait until condition with messages. But Scott (Raney) told me that the wait for messages in the repeat loop is much more efficient as the condition is tested only when a message is sent. In the single liner, the condition is tested continually ( a bit like idle). My own limited testing at the time didn't seem to show a great difference in how often the condition was tested. But the explanation seemed sensible, so I stuck with the wait for messages in the repeat loop. Cheers Dave ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait with messages...
On Sunday, February 1, 2004, at 02:47 AM, Dave Cragg wrote: repeat until condition wait for messages end repeat It seemed the same as this: wait until condition with messages. I think I get it. Use the first for testing something that will be set by a callback. Use the second if there is no callback as in polling the shift key or calling an external. It would be nice if there was a way to filter what messages got processed. Dar Scott ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: wait with messages...
--- Chipp Walters [EMAIL PROTECTED] wrote: YIH (yep it helps) you talkin Tex ageein. = [EMAIL PROTECTED]http://www.erikhansen.org __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: wait with messages...
Chipp, I usually use the form: wait until something with messages which allows for normal idle-time message processing while Rev waits. For example, one thing that has been bugged in Bugzilla is that opening up a popup menu remotely: popup (long id of btn ContextPop of card 1 of stack MyStack) at the mouseLoc is modal on MacOS (i.e. it waits until you pick something from the menu before it goes to the next script line), but on Windows, it's not (it pops up the menu and immediately goes to the next script line). So to get around it, I have added right after it: if the platform is Win32 then wait until the mouse is up with messages end if This causes the script to pause, but allows other things to happen (pendingMessages get sent, etc.). HTH, Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chipp Walters Sent: Saturday, January 31, 2004 1:58 AM To: How to use Revolution Subject: wait with messages... Scott, (and anyone else who) I use send fred to this cd in 30 milliseconds all the time, but I'm really not sure what wait with messages and wait for messages do The docs don't explain it very clearly...at least not to me:-( Does it: wait until any message whatsoever fires and then continue? Which means the RR IDE would fire it as it's sending messages all over the place. Can you provide an example where you would use one and not the other or not 'send'? tia, Chipp ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use- revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: wait with messages...
Ken, Thanks for the explanation. How would you use: wait for messages and wait with messages ?? Would it be something like: wait for 4 seconds with messages ?or: wait for messages (pauses handler until *any* message is received? and why would I ever use this?) I have a feeling there's some great power here, I just want to understand how to use it! YIH (yep it helps) Chipp -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ken Ray Sent: Saturday, January 31, 2004 11:34 PM To: 'How to use Revolution' Subject: RE: wait with messages... Chipp, I usually use the form: wait until something with messages which allows for normal idle-time message processing while Rev waits. For example, one thing that has been bugged in Bugzilla is that opening up a popup menu remotely: popup (long id of btn ContextPop of card 1 of stack MyStack) at the mouseLoc is modal on MacOS (i.e. it waits until you pick something from the menu before it goes to the next script line), but on Windows, it's not (it pops up the menu and immediately goes to the next script line). So to get around it, I have added right after it: if the platform is Win32 then wait until the mouse is up with messages end if This causes the script to pause, but allows other things to happen (pendingMessages get sent, etc.). HTH, Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chipp Walters Sent: Saturday, January 31, 2004 1:58 AM To: How to use Revolution Subject: wait with messages... Scott, (and anyone else who) I use send fred to this cd in 30 milliseconds all the time, but I'm really not sure what wait with messages and wait for messages do The docs don't explain it very clearly...at least not to me:-( Does it: wait until any message whatsoever fires and then continue? Which means the RR IDE would fire it as it's sending messages all over the place. Can you provide an example where you would use one and not the other or not 'send'? tia, Chipp ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use- revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait for messages
At 5:26 PM -0800 2/25/2002, David Vaughan wrote: Replying to myself ;-) ... of course the wait {N time} with messages will wait the time you define while allowing other actions, and is not accelerated by those actions, whereas wait {N time} simply waits. None of this makes wait for messages, apparently meaning a random time up to half a second, very useful ... so far. I have taken a look at what wait for messages is doing. It works as documented - that is, it waits until a message is sent - in a standalone (or in MC, for that matter) but it times out after 30 seconds in Rev's development environment. In these situations your handler shows results as you'd expect. My best guess at the moment is that the dev environment is sending a message every 30 seconds that has the effect of timing out wait for messages I'm still getting more info on this and whether it might be changeable. But it does work properly in a standalone, or when launched without the development environment running. -- Jeanne A. E. DeVoto ~ [EMAIL PROTECTED] http://www.runrev.com/ Runtime Revolution Limited - Power to the Developer! ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: wait for messages
OK, I've waited a bit for a Transcript guru to answer Bob's questions (in shortened form below) but nothing has clarified this so far. So I tried a couple of experiments myself, effectively replicating Bob's results. These are two of my tests: In the stack I put this idle handler (oh shame!) on idle global gFrog add 1 to gFrog end idle and in a button this script: on mouseUp global gFrog put zero into gFrog put empty into field 1 put empty into field 2 repeat with i = 1 to 50 wait for messages put i comma after field 2 put gFrog comma after field 1 end repeat end mouseUp The result was that messages continue to flow during the repeat loop, but only slowly, a shade faster than the idle message (and therefore it was not the idle message, as promised by the documentation). If I moved the mouse during the loop then it accelerated dramatically. I ditched the idle script and changed the button script to: on mouseUp put empty into field 1 put empty into field 2 put the ticks into tickTime repeat with i = 1 to 50 wait for messages put (the ticks - tickTime) comma after field 2 put the ticks into tickTime end repeat put average(field 2) into field 1 end mouseUp Being careful not to move the mouse, I clicked the button and saw tick delays of 6,17 and 32 for the first three instances after which it settled down to 30 tick intervals with the occasional 29 (average 29 ticks). Wriggling the mouse accelerated the loop to 1-2 tick delays. So, part of the answer seems to be that "wait for messages" will wait up to 30 ticks for a message and then continue processing anyway. In fact, it may wait only 6 or so ticks on the first pass. This is not what the documentation says, and also leaves the value of the construct rather uncertain. Incidentally, in a separate test I found that waitDepth remained at 1 before, during and after a loop such as the above. This seems correct if it means that only the mouseUp handler was executing. Is there any further enlightenment that can be offered on the "Wait for messages" command please? I am comfortable at the moment with the "with messages" form. Unless further experiments have offered him enlightenment, Bob is probably still pretty curious too. regards David On Monday, February 25, 2002, at 01:00 , Bob Rasmussen wrote: Can anyone give me some insight about the "wait for messages" command? Is there a way to see what messages are causing "wait for messages" to stop waiting? Is there a way to get a message trace in general? That would be extremely useful. Devin Asay asked for a Message Watcher today. I didn't use it much in HC but it would certainly have been useful here. What does the following note in the "waitDepth" entry of the Transcript Dictionary mean? "The wait for messages form of the wait command allows Revolution to respond to messages and execute handlers while waiting." Speaking of "waitDepth", if there are multiple waits pending, in what order to they resume? Last first? Last last? Unspecified? Does a message resume all waiting handlers, or just the next in line? I'm guessing all, if the documentation is correct, but the resumption order question still pertains. I've looked in the Revolution stacks for examples of "wait for messages". They all look something like this: . . . repeat while someStatus is empty wait for messages end repeat
Re: wait for messages
Bob I think we can now answer some of your questions: Why should it have worked the first time, but not subsequently? In my experience, it never waited (in the indefinite sense) and I have no idea why it waited for you even once. Your system had some coincidental activity that slowed it down at the critical moment? Are there messages a script can never see (or that bypass the usual message hierarchy) that, nevertheless, satisfy the wait condition of "wait for messages"? I doubt it. It just seems to time out after a period up to 500ms. Is there a way to see what messages are causing "wait for messages" to stop waiting? Thanks to Richard Gaskin's Umbrellaman, just posted, I checked and there are no known messages causing it to time out. It just stops, as I said above. Is there a way to get a message trace in general? That would be extremely useful. Indeed it is. Check Richard's post and stack. What does the following note in the "waitDepth" entry of the Transcript Dictionary mean? "The wait for messages form of the wait command allows Revolution to respond to messages and execute handlers while waiting." As I said in my earlier post on this, "wait N time" stops other handlers while it waits whereas "wait for messages" allows them to execute while it waits up to half a second, and "wait N time with messages" waits that time while allowing other events and handlers to execute. Shouldn't that be "... with messages form ..."? ...well, that is more useful, I think. snip Speaking of "waitDepth", if there are multiple waits pending, in what order to they resume? Last first? Last last? Unspecified? It appears to me that the waitDepth shows the number of handlers executing, not the messages waiting. This is pretty much what the documentation says. The tests above (one button) showed a waitDepth of 1 while the test below (used two buttons, waiting one while pressing another) showed a waitDepth of 2. Does a message resume all waiting handlers, or just the next in line? I'm guessing all, if the documentation is correct, but the resumption order question still pertains. I've looked in the Revolution stacks for examples of "wait for messages". They all look something like this: . . . repeat while someStatus is empty wait for messages end repeat . . . Why wasn't the command "wait while someStatus is empty with messages" used instead? Can't answer for why, but... Are these equivalent? ...they are not equivalent. The "wait while...with messages" construct will barrel along handling all messages and executing all handlers other than the one with the wait statement, until the wait is satisfied when it, too, will resume. A "wait for messages" form will continue execution of that handler after 500ms even where nothing else has happened. One potential difference I see is that the repeat loop won't pause for messages if the loop condition is false, while "wait while" might require at least one message to proceed, even if the condition is already false. Is that right? No, it isn't. The condition is checked immediately and, if false, processing continues. Sorry for being longwinded, but a detailed section in the documentation on execution order, in the presence of waits and sends, would be welcome, and I'm hoping all these questions prompt some of its contents. Execution order is the usual chronological order of events (and their messages). It is not mucked around by wait except to the extent that a script is halted in certain usages or that other handlers can execute during that time, but, again, in their natural order. All my comments are research-based, not guru-given, so forgive me for any errors, omissions or lack of clarity. My tentative conclusion, incidentally, is that "wait...with messages" is great and "wait for messages" is useless. Whether or not the last is true, the documentation on it needs improvement. regards David
Re: wait for messages
Title: Re: wait for messages on 2/24/02 6:00 PM, Bob Rasmussen at [EMAIL PROTECTED] wrote: Can anyone give me some insight about the wait for messages command? -- I'm still a long ways from understanding all the new stuff in MC/RR different from HC, but I'm betting if no pending messages exist, it will freeze until RR gets a message, which would explain why the simple handler you wrote continued only after you moved the mouse, which sent a message, of course. If anything sends any message, open a card, move the mouse, type something, any message except idle, the script will take off again as soon as RR gets it. This gives some more control to the user. Everything (but idle) stops right where it is, if they need to answer the phone, stop the coffemaker from boiling over, whatever, but if RR was in the middle of making computations, that would continue. It probably wouldn't suspend computing, but it would stop the rest of the script from running until the user hits a key or moves the mouse, like what happens with a screensaver. Just a hunch. Best regards, Ken N.