Pendingmessages

Ken Ray kray at sonsothunder.com
Fri Mar 2 16:02:41 EST 2007


On Fri, 2 Mar 2007 13:14:08 -0700, Richard Miller wrote:

> Will "lock messages" halt "pending messages" from occurring until an 
> unlock messages command is sent?
> 
> I need to have all pending messages that relate to file transfers to 
> wait until a foreground file transfer is complete. I'm thinking that 
> "lock messages" will do that. If not, is there another way?

I don't think that lock messages will affect pending messages. Here's 
an approach I've used that works pretty well, so long as you don't have 
really complex messaging needs:

on PausePending pMsg
  global gPendingMessages
  put the pendingMessages into tPending
  if (pMsg <> "") and (pMsg <> "all") then filter tPending with "*," & 
pMsg & ",*"
  put tPending into gPendingMessages
  repeat for each line tMsg in tPending
    cancel item 1 of tMsg
  end repeat
end PausePending

on ResumePending pMsg
  global gPendingMessages
  put gPendingMessages into tPending
  if (pMsg <> "") and (pMsg <> "all") then 
    filter tPending with "*," & pMsg & ",*"
    filter gPendingMessages without "*," & pMsg & ",*"
  else
    delete global gPendingMessages
  end if

  -- Resend the messages
  repeat for each line tLine in tPending
    put item 3 of tLine into tCmd
    put item 4 of tLine into tTarget
    do "send" && quote & tCmd & quote && "to" && tTarget
  end repeat
end ResumePending

HTH,

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list