Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Synchronizing multiple Winbatch scripts

Keywords: sync synchronizing 

Occasionally someone needs to have multiple Winbatch scripts running in parallel, and to both synchronize them and pass data to and fro. The usual method was to poll an INI file. But one of our more advanced users came up with a much better way...

The idea is to use the Window title of the WinBatch window itself. In this example there is a "server" application waiting to be told what to do, and a "client" application telling it what to do.

Server Code

mynormaltitle="Fruitcake Server"     ;pick a unique name
WinTitle("",mynormaltitle)	     ;set winbatch window to unique name
while 1
   WinWaitClose(mynormaltitle)	     ;wait for title to change
   command=WinName("")		     ;grab new title
   WinTitle("",mynormaltitle)	     ;reset original title
   Message("Passed Command was",command)
end while

Client Code

   command=AskLine("Test","Enter command","yoo hoo")
   WinTitle("Fruitcake Server",command)

Article ID:   W13803
Filename:   Syncing Multiple Winbatch Scripts.txt