| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Fri Apr 25, 2003 10:07 am Post subject: AutoClose or Auto Logoff |
|
|
I am writing a database type program. The users will login with a username and password.
I want the ability to automatically logoff or close the program if they don't use it say for 2 minutes etc.
Any sample scripts or code would be gratefully accepted !
Nathan |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Fri Apr 25, 2003 3:10 pm Post subject: |
|
|
Yeh, i thought of that but i am using the timer to update the status bar !
Could i do something like:
:evloop
wait event,0
%x = @event()
goto %x
:timer
dialog set,status,information etc etc
if @null(%x)
TIMER START,1,CTDOWN,00-00:02:00
else
TIMER STOP,1
end
goto evloop
:TIMER1CTDOWN
INfo You are now being Logged Out....
exit
Nathan |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Fri Apr 25, 2003 6:35 pm Post subject: |
|
|
What about something like this?
| Code: | :Evloop
%%time = @datetime(hhnnss)
%%etime = @sum(@datetime(hhnnss),120)
wait event,1
goto @event()
:Timer
rem Process code here
if @greater(%%time,%%etime)
info You are now logged out...
rem Process logout
end
goto Evloop |
_________________ FreezingFire
VDSWORLD.com
Site Admin Team |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Fri Apr 25, 2003 11:03 pm Post subject: |
|
|
hi rubes_sw,
your code looks ok to me...i haven't run it but it looks good...give it a try
a thought...the timer will be stopped if your user clicks on a button or a menu item or anything that will generate an event...what if he is typing something in an edit box...or don't you have any of those?
an alternative...and i have done this in several of my programs...when a user accesses the interface a timer starts (the lenght of which they can set in the settings part of the program) and i have a level bar displayed that keeps up with the countdown...if the user needs more time, they then just click on the level bar and the timer starts again from the top...if they don't then the program does whatever you want it to...does that make sense?
Serge _________________
|
|
| Back to top |
|
 |
|