Pendingmessages
Andre Garzia
soapdog at mac.com
Fri Mar 2 17:32:54 EST 2007
I know it is a hack, but you can use a global and save/restore it's
state when needed...
In case we had some nifty function, a cousin of the functiona
'variableNames' that could access all the current variables in memory
and their context, we could then freeze the engine state to some
container and restore it or bits of it as we needed them.
This alone would give us means to create:
* continuations. (it would help you to freeze a message from
pendingMessage and restore it later)
* co-routines. (so we could have sort of cooperative threading in a
single thread engine)
Cheers
andre
On Mar 2, 2007, at 7:11 PM, Peter T. Evensen wrote:
> One problem here is that any parameters sent with the message will
> be lost, since pendingMessages does not contain parameter information.
>
> At 03:02 PM 3/2/2007, you wrote:
>> 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/
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> Peter T. Evensen
> http://www.PetersRoadToHealth.com
> 314-629-5248 or 888-682-4588
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list