Wait with messages

Mark Schonewille m.schonewille at economy-x-talk.com
Sat Feb 23 13:09:29 EST 2008


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" <m.schonewille at economy-x-talk.com>
> To: "How to use Revolution" <use-revolution at 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
>>
>>
>>




More information about the use-livecode mailing list