forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


AutoClose or Auto Logoff

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Fri Apr 25, 2003 10:07 am    Post subject: AutoClose or Auto Logoff Reply with quote

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 ! Very Happy Very Happy


Nathan
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Apr 25, 2003 2:50 pm    Post subject: Reply with quote

You can do it the easy way, by using this as your Evloop...

Code:

:Evloop
wait event,120
goto @event()

:Timer
info You are now logged out...
goto Evloop

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Rubes_sw
Valued Contributor
Valued Contributor


Joined: 11 Jun 2001
Posts: 625
Location: Northern Ireland

PostPosted: Fri Apr 25, 2003 3:10 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Apr 25, 2003 3:23 pm    Post subject: Reply with quote

I don't know how the timer command works... Wink

Btw. Maybe you should use the [ code ] BBCode function if you post code. It makes it easier to read/copy, because you can then see the syntax you used...

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Fri Apr 25, 2003 6:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Apr 25, 2003 11:03 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group