REM This program shows how to detect when the Psion has been turned on rem define KEvSwitchOn& include "Z:\SYSTEM\OPL\CONST.OPH" rem define SetForeground OPX procedure include "Z:\SYSTEM\OPL\SYSTEM.OXH" PROC MAIN: local event&(16) rem Use SETFLAGS to tell OPL to report the switchon event setflags &10000 do rem getevent32 is a command rather than a procedure call GetEvent32: event&() rem Long integer constant, so needs a & on the end IF event&(1)=KEvSwitchOn& SetForeground: giprint "Switched On" endif until 0 ENDP