Make a Function TimeOut after a certain interval (1 Viewer)

tembenite

Registered User.
Local time
Today, 11:05
Joined
Feb 10, 2005
Messages
38
Anyone know how I'd make a function automatically time out after a given interval, regardless if one of the tasks its running has finished yet? I know how to pull the time info from the Timer, but not how to use that information to time out the function. Thanks!
 

Bat17

Registered User.
Local time
Today, 16:05
Joined
Sep 24, 2004
Messages
1,687
you would need some sort of loop within the function that will let you check status.

Peter
 

tembenite

Registered User.
Local time
Today, 11:05
Joined
Feb 10, 2005
Messages
38
If I put the function that called something within a while loop, that uses the timer function, is it automatically going to time out right at the interval I set? (or is it going to wait until it hits the WEND argument?).

My problem is that a windows API I'm calling (which does not accept a timeout argument), will occasionally take forever to call. However, if it hasn't gotten a responce after 10 seconds, it never gets the responce (though it will sometimes hang up to 60 seconds before continueing). I'd like to make it so if it hasn't gotten a responce after 10 seconds, to automatically quit out of the function (and return a null value). This does me no good if the function is going to wait for the API to timeout first, before my timeout is even looked at.
 

tembenite

Registered User.
Local time
Today, 11:05
Joined
Feb 10, 2005
Messages
38
Somebody has to have a solution for this. Anyone?
 

Bat17

Registered User.
Local time
Today, 16:05
Joined
Sep 24, 2004
Messages
1,687
Sorry I can't see a way to help you :(

Maybe someone else will
Peter
 

WayneRyan

AWF VIP
Local time
Today, 16:05
Joined
Nov 19, 2002
Messages
7,122
tembenite,

The only timers supported in Access (other than APIs) are form-related.

You could open a form (with its associated timer) that performed the
desired function ... and timed out if the TimerEvent was activated.

Wayne
 

Users who are viewing this thread

Top Bottom