\ Application Skeleton 19Jul2005 ERS needs resources needs case \ add other required library modules needs My-Helper \ add your own helper modules 3000 constant AboutBox \ add your own data definitions as needed (id) ( your registered creator id here ) 2constant oID \ your supporting words here : eventloop begin ekey case MenuEvent of event-id case AboutMenuItem of AboutBox FrmAlert drop endof \ insert more menue items endcase endof \ insert more events to be handeled within \ your application endcase again ; \ main event loop to handle the menu bar and \ controls in the forms : doAppMain \ perform initializations \ set up the GUI etc. eventloop ; \ main program for normal launch : doNotify ( --- ) \ handle notifications ; : doSync \ perform actions required after syncronization ; : doReset \ perform actions required after a reset ; : doAlarmtriggered ( --- ) \ perform ( fast ) actions when an alarm was triggered ; : doDisplayalarm ( --- ) \ perform actions when an its OK to perform more \ extensive actions to handle an alarm ; : doApp launchcode case SysAppLaunchCmdAlarmTriggered of doAlarmtriggered endof SysAppLaunchCmdDisplayAlarm of doDisplayalarm endof SysAppLaunchCmdSystemReset of doReset endof SysAppLaunchCmdNotify of doNotify endof SysAppLaunchCmdSyncNotify of doSync endof SysAppLaunchCmdNormalLaunch of doAppMain endof \ add more launchcodes as needed endcase ; \ launchcode dispatcher : doBye ['] doApp catch dup byeThrow = if \ cleanup stuff, e.g. free allocated memory then throw ; \ ---- Compile(r) Instructions oID (id) rsrc use-resources \ your resources SysAppLaunchCmdAlarmTriggered activate-launchcode SysAppLaunchCmdDisplayAlarm activate-launchcode SysAppLaunchCmdSyncNotify activate-launchcode SysAppLaunchCmdSystemReset activate-launchcode SysAppLaunchCmdNotify activate-launchcode \ add more launchcodes as needed ' doBye oID makeprc MyApplication 1001 formRscType delrsrc drop AboutBox alertRscType copyrsrc \ add or delete resources as needed