Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timer side effect \ force exit
Message
From
25/11/2009 09:50:29
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01436566
Message ID:
01436580
Views:
38
I agree,
here is few code from my timer
if file('Server\others\mnti.txt')=.t.
	nmessagebox=messagebox('Warning!!!!!!!!!!!!!'+replicate(chr(13),4)+'System Will Be Turned Off Automatically In 30 sec. '+ ;
		replicate(chr(13),4)+'Press Ok ONLY If You Do Not Want To Be Turned Off!',0+16,oapp.msgtitle,30000)
	if nmessagebox=-1	&& timeout- close the system
		do quitapp
		return
	endif
	this.interval=int(this.interval/2)
	if this.interval<111
		this.interval=12345
	endif
	this.enabled=.t.
	return
endif
I ask about potential risk of running the timer in the middle of other procces.



>Where I implemented the timer with closing all application forms and application the user gets a message first warning him/her that the application will be closed and suggesting they save the data. And only about in a min or so (user-defined) time the application is closed. This gives user time to finish whatever he/she does.
>
>HTH.
>
>>Hi,
>>Thank's for respond.
>>
>>I dont ask about current unsaved data or how to close all from etc,
>>
>>I ask about case that user will save\export data and in the middle of that procces the timer will start his job - I dont have 30 second procces of saving data but I ask about the 10 seconds procces if the timer will start to look for txt, counting the time, moving to messagebox etc - all of this in the middle of the 10 seonds of saving.
>>
>>Sorry for my poor english, I hope it's understand.
>>
>>>>Hi all
>>>>
>>>>I have to build option of forcing all the users to close the program (program will be closed automatically 30 seconds after the users getting proper message).
>>>>
>>>>
>>>>I think about creating txt that when ever this file exist the project will logoff the user and will stop him to start the program before tring to accsess to the tables.
>>>>
>>>>I agree to take the risk of case that I will forgat to delete\rename the TXT, but I afraid to put timer on my top form that check once a minut if file exist what if it's will be in middle of other procces?
>>>>
>>>>?
>>>>
>>>>Thanks
>>>
>>>I found this message Re: Releasing while the Preview Window open Thread #1121802 Message #1121807 which may be of help.
>>>
>>>And Re: How to close application when having a preview open? Thread #1067133 Message #1067157
Thank you
Chaim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform