launching on Wintel/inter-process communication
Richard Gaskin
ambassador at fourthworld.com
Tue Dec 3 13:42:01 EST 2002
Larry_R_Huisingh at rl.gov wrote:
> Actually, with MC, polling can be clean and very easy to implement via the
> "send" command. At the beginning of your program you "send" a message that
> will execute in 1 second. Set up a handler for that message to do the poll
> and at the end of that routine issue a send of that same message for another
> second later. That way the handler sets up the next poll. The main
> routines don't ever have to have polling in their loops.
Here's the routine I wound up using for "listening":
on PollForIPCDataFile
put SpecialFolderPath("temporary")&"/fwmcicptemp.dat" into tTempFile
if there is a file tTempFile then
put url ("file:"& tTempFile) into tFileToOpen
get the result
if (it is not empty) then
answer "Error reading communication file: "& it
exit to top
end if
if (there is not a file tFileToOpen) then
answer "Couldn't open file ""e&tFileToOpen"e
exit to top
end if
delete file tTempFile
LoadBook tFileToOpen
end if
send "PollForIPCDataFile" to me in 700 millisecs
end PollForIPCDataFile
--
Richard Gaskin
Fourth World Media Corporation
Developer of WebMerge 2.1: Publish any database on any site
___________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
Tel: 323-225-3717 AIM: FourthWorldInc
More information about the metacard
mailing list