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.

502.8.CreatingaWindowApplication returnParms; blockbegin<br />

Notetheon(others)exceptionh<strong>and</strong>ler.Thisisashorth<strong>and</strong>notation, endprocess on(others) endblock; ParmString);<br />

returnParmsexceptionNotCreated; callClient(ClientGetLine,ClientPutLine,ClientGetPgm,<br />

clientwithinaninnerblockwithanullon(others)h<strong>and</strong>ler. tocauseaNotCreatedexception.Therefore,weenclosethecalltothe theclientiscreated,wedon'twantexceptionsreturnedbytheclientitself tocreatetheclient.Theh<strong>and</strong>lerwillreturnaNotCreatedexception.Once Inthisexample,thish<strong>and</strong>lerwillbeenteredifanythinggoeswrongtrying signifying\h<strong>and</strong>leallexceptionswhicharenotalreadyexplicitlyh<strong>and</strong>led".<br />

guages,sowedidn'tbotherexplainingthem. process.Forexample,supposethatinsteadofloadingQuitDispatcher literals,like'true'.Theseliteralsarejustliketheliteralsoffamiliarlan-<br />

stringliterals,like"Hello,World!",integerliterals,like0,<strong>and</strong>boolean compile-time,weneednotcallGetProgramtoloadtheseprogramsfrom theprogramlibraryatruntime.Wedothisusingaprogramliteral. Aprogramliteralisjustprogramtextdelimitedbyprocess<strong>and</strong>end Aliteralisanexpressionwithacompile-timeknownvalue.Wehaveused Sincethecodeofthequitdispatcher,adapter,<strong>and</strong>buerareknownat<br />

fromthelibrary,weusedaprogramliteralinstead.Hereistherelevant fragmentofmoduleApplicationBuilder: call(QuitDispOut#(createofprocess(Init:QuitDispIn) begin declare Quit1:QuitOut; Quit2:QuitOut; Quit:QuitIn; QuitCM:QuitInterface; newQuit;connectParms.QuittoQuit; receiveParmsfromInit; Quit1:=Parms.Quit1; Parms:QuitDispInterface;<br />

Quit2:=Parms.Quit2; returnParms; receiveQuitCMfromQuit; callQuit1(); callQuit2();

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

Saved successfully!

Ooh no, something went wrong!