00001 def new global shared var prog-started as log. 00002 def new global shared var u-name as char. 00003 00004 def shared var screen-title as char. 00005 00006 def shared var total-floor-no as int init 4. 00007 def shared var room-types as char extent 5. 00008 00009 def shared var res-state as char extent 4. 00010 def shared var res-state-ch as char extent 4. 00011 00012 def shared var res-state-placed as int init 1. 00013 def shared var res-state-canceled as int init 2. 00014 def shared var res-state-checked-in as int init 3. 00015 def shared var res-state-checked-out as int init 4. 00016 00017 prog-started = true. 00018 00019 def var timer as int. 00020 00021 put screen color message row screen-lines + 1 "Do you want to quit?". 00022 put screen color underline row screen-lines + 1 column 22 "NO". 00023 bell. 00024 00025 timer = 60. 00026 00027 P-TIMER: 00028 do while timer >=0: 00029 readkey pause 1. 00030 put screen color normal row screen-lines + 2 00031 "Auto-logout in " + string(timer) + " seconds.". 00032 timer = timer - 1. 00033 00034 if lastkey ne -1 then do: 00035 if caps(keyfunction(lastkey)) = "Y" 00036 then do: 00037 publish "pop-program". 00038 leave P-TIMER. 00039 end. 00040 else do: 00041 publish "pop-program". 00042 return. 00043 end. 00044 end. 00045 end. 00046 00047 quit.