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.

name.Ifwewaitedtobuildtheapplicationrst<strong>and</strong>thencheckfora DuplicateKeyexception,theillegalapplicationmayhavealreadystarted 482.7.TheWindowManager exceptionbycheckingrstfortheexistenceofawindowwithidentical running<strong>and</strong>mayhavealreadyproducedoutput.Theexistsofoperator checksforthiscase.Thisoperationtakesaselector<strong>and</strong>evaluatestotrue if<strong>and</strong>onlyifoneormoreselectedelementsexist. TheonlytrickybitisthatwemustavoidthepossibilityofaDuplicateKey Todestroyawindow,wesimplyremovethewindowdescriptorfromthe endif;<br />

application.ThisservicewillcallQuitonthebuerprocess<strong>and</strong>theadapter process,withtheresultthattheclientprocesswillshutdown. tableofcreatedwindows<strong>and</strong>thencalltheQuitportassociatedwiththat eventKill receiveKillCMfromKill;<br />

endblock; on(NotFound) blockbegin callCurrentWindow.Quit(); returnKillCMexceptionNotFound; --erroraction discardCurrentWindow; returnKillCM; removeCurrentWindowfromCreatedWindows[KillCM.WindowName];<br />

eventGetFocus receiveGetFocusCMfromGetFocus; then ifCurrentFocus""<br />

portsfromprocesstoprocess. thiscodewhenyouhavetables,exceptionh<strong>and</strong>ling,<strong>and</strong>theabilitytopass Thisnishesthewindowmanager.Noticehowconvenientitistowrite endif; else returnGetFocusCMexceptionNotFound; returnGetFocusCM; GetFocusCM.Focus:=CurrentFocus;<br />

isastraightforwardvariationofFilter. 2.8CreatingaWindowApplication orWMSystem,itshouldbeeasytobuildApplicationBuilder.AndAdapter Allthatisleftaretheapplicationbuilder,theadapter,<strong>and</strong>thequitdispatcher.Theseprogramsusenonewprinciples.IfyoucanbuildCompound

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

Saved successfully!

Ooh no, something went wrong!