Pausing Program Execution - 5 Minutes

  • Thread starter Thread starter Fred Nelson
  • Start date Start date
F

Fred Nelson

Hi:

I'm trying to write a routine that will permit my VB.NET program to
pause execution for five minutes and try a task again if there is a
failure. After a set number of tries it should return a failure
notification.

I know how to do everything except make it hibernate for five minutes -
if anyone knows how to do this I would GREATLY apprecaite it!

============================================
Logially:

dim error_counter as integer = 0

while error_counter < 10

if callmainfunction()
' it worked - return
return .t.
endif

' add one to the error counter:
error_counter += 1

** wait five minutes

"system.sleep(5 minutes)"

end while

return .f.
==========================

Thanks very much!

Fred
 
Hi Again:

I found that:

system.threading.thread.sleep(miliseconds)

works just fine!
 
* Fred Nelson said:
I found that:

system.threading.thread.sleep(miliseconds)

Notice that this will block your app's user interface when calling this
method from within your main thread.
 
Herfried:

I have noticed that and in this case its OK. I force a status box that
I'm using to perform a .UPDATE() so I can see what's going on.

Thanks for your help!

Fred
 
Fred,

And when not, you can set it in a simple loop doing it 300 times a second
and place in that loop

application.doevents

Just a simple addition.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top