wait with messages revisited.

K nnoydb at excite.com
Mon Nov 1 11:24:35 EST 2004


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!


More information about the use-livecode mailing list