On 10/2/12 3:42 PM, John Craig wrote:
Hi, Craig.  Looks like the trouble is that you've always got a pending
message, so after you press stop, there's another message fired
immediately to start things rolling again.

try this handler in the card;

command cancelMessages pMessages
    -- cancel any pending messages in the pMessages list
    if pMessages = empty then exit cancelMessages
    put the pendingMessages into tPending
    repeat for each line tMsg in tPending
       put item 1 of tMsg into tID
       put item 3 of tMsg into tName
       if tName is among the items of pMessages then cancel tID
    end repeat
end cancelMessages



and change your showRandoms command to;


on showRandoms tSecs
    put random(99)
    if tSecs = 0 then
       cancelMessages "showRandoms"
       exit to top
    end if
    if tSecs > the seconds then send "showRandoms" && tSecs to me in 10
millisecs
end showRandoms


HTH  :)

Ah, that's it. I tried handling pending messages differently but in the wrong place:

on showRandoms tSecs
  put random(99)
  wait 0 with messages
  if tSecs = 0 then
    exit to top
  end if
  if tSecs > the seconds and "showRandoms" is not in the pendingmessages
  then send "showRandoms" && tSecs to me in 5
end showRandoms

Your way works.

--
Jacqueline Landman Gay         |     jac...@hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to