28.01.2015 Views

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

522.8.CreatingaWindowApplication<br />

begin QuitCM:QuitInterface; --initialization Running:boolean;--trueifprocesshasnotbeenshutdown WindowName:Charstring;--nameofwindow GetProgramCM:GetProgramInterface; PutCM:PutLineInterface; Window:WriteToWindowOut;--accesstowindow<br />

receiveParmsfromInit; GetProgramOut:GetProgramOut;--accesstoGetProgramservice<br />

newPut;connectParms.ClientPutLinetoPut; newGet;connectParms.ClientGetProgramtoGet; GetProgramOut:=Parms.GetProgram; WindowName:=Parms.WindowName; Running:='true'; returnParms; --serviceloop while(Running)repeat newQuit;connectParms.QuittoQuit; Window:=Parms.AdapterToWindow; select eventPut<br />

eventQuit eventGet returnGetProgramCM; callWindow(WindowName,PutCM.Line); receivePutCMfromPut; receiveGetProgramCMfromGet; returnPutCM;<br />

endselect; otherwise--shouldnotoccur receiveQuitCMfromQuit; Running:='false'; returnQuitCM; callGetProgramOut(GetProgramCM.Name,GetProgramCM.TheProgram);<br />

QuitDispatcher:using(QuitDispatcher,Quit)process(Init:QuitDispIn) declare Quit1:QuitOut; Quit2:QuitOut; Parms:QuitDispInterface; endprocess endwhile;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!