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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

foreyoudonotdeclareWindowexplicitly.Withinthatscope,thevariable Windowcontainsaconstantcopyofoneoftheselectedelementsofthetable.Fororderedtables,theiterationsoccurintheorderthattheselected<br />

elementsoccurinthetable.Forunorderedtables,theiterationsoccurin Liketheinspectstatement,theforstatementcreatesascope.There-<br />

inspect endfor; callPutLine(Window.WindowName); 2.AMiniatureSystem47<br />

anarbitraryorder.<br />

InputToWindow<strong>and</strong>Quit.Wegettheseportsbycreatinganapplication Thenewwindowrecordcontainsthewindow'sname,<strong>and</strong>thetwoports we'regoingtobuildanewwindowrecord,<strong>and</strong>insertitintothetable. viationisparticularlyusefulintheforstatement. Nowlet'sdocreation<strong>and</strong>destructionofwindows.Tocreateawindow, 2.7.5Creating<strong>and</strong>KillingWindows Theconstructwhere('true')maybeabbreviatedas[].Thisabbre-<br />

processes,<strong>and</strong>returnthetwodesiredports.Wehavetopasstheapplicationbuildertheseparameters:theprogramname<strong>and</strong>parameterstring,<br />

aconnectiontoGetProgram,<strong>and</strong>aconnectiontoWriteToWindow.The structuresdened: codeisverystraightforwardnowthatwehavealltheinterfaces<strong>and</strong>data eventCreate else receiveCreateCMfromCreate; ifexistsofCreatedWindows[CreateCM.WindowName] then blockbegin returnCreateCMexceptionDuplicate; --erroractionbecausewindowalreadyexists newCurrentWindow; CurrentWindow.WindowName:=CreateCM.WindowName; call(WindowApplicationOut#(createofApplicationBuilder))<br />

builderprocess.Theapplicationbuilderwillcreatethethreeapplication<br />

endblock; on(WindowApplicationInterface.NotCreated) returnCreateCMexceptionCreateFailure; insertCurrentWindowintoCreatedWindows; returnCreateCM; --erroractionifunabletocreateprocess (CreateCM.ProgramName,CreateCM.ParmString, CurrentWindow.InputToWindow,CurrentWindow.Quit); GetProgram,WriteToWindowCapability,CurrentWindow.WindowName,

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

Saved successfully!

Ooh no, something went wrong!