Home > Archive > Clarion > March 2006 > Critical problem: Timer & Closing the APP automatically
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Critical problem: Timer & Closing the APP automatically
|
|
| Developer 2006-03-09, 6:55 pm |
| Hi guys,
Please thank you for your ideas how to solve this problem:
I need to auto-close my Clarion 6.1 APP after x minutes of inactivity
and just now I'm testing the code and it doesn't work:
1. Timer in APP Frame is set to 100 (every sec)
2. My source code in "Other Window Event Handling" embed of the main
frame
CASE EVENT()
OF EVENT:Timer
GLO:Inactivity += 1
CASE EVENT()
OF KEYCODE()
GLO:Inactivity = 0
END
IF GLO:Inactivity > GLO:Inactive_Mins_Lock * 60 !Checking time in
seconds
!Start the login procedure - the program is locked
GLO:Inactivity = 0
POST(Event:Accepted,?Button11) !The login procedure is called
END
IF GLO:Inactivity > GLO:Inactive_Mins_Shut * 60 !Checking time in
seconds
!Shutdown the program
POST(EVENT:CLOSEDown) !The instance of the application is gone
RETURN
END
END
!Global vars defined:
GLO:Inactive_Mins_Lock, Long !Number of minutes when the inactive
program session is locked
GLO:Inactive_Mins_Shut, Long !Number of minutes before auto closing
inactive program
GLO:Inactivity, Long !Inactivity Counter
The Problem:
-------------------
The counter is not reset in the Timer event (GLO:Inactivity = 0), so
irrespective if the user is working in child procedure and "types"
keycodes the Timer thinks that the program is inactive.
It looks that the code below is never called:
CASE EVENT()
OF KEYCODE()
GLO:Inactivity = 0
END
Do you have any ideas?
Thanks,
Alfred
| |
| Developer 2006-03-16, 7:55 am |
| OK, problem solved.
The best solution was to convert the old APP to ABC and change the
process properly :-)
Cheers,
Alfred
|
|
|
|
|