PDA

View Full Version : Solved: Application.Wait question



paulked
08-22-2007, 07:32 PM
Why does this If Application.Wait(Now + TimeValue("0:00:0001")) Then
have the same outcome as If Application.Wait(Now + TimeValue("0:00:01")) Then
?

Just something I noticed in the earlier Splash Screen post.:dunno

daniel_d_n_r
08-22-2007, 11:43 PM
Not too sure but as I remember the wait instruction only has a resolution of seconds, not milliseconds.
The first extract you have there is reverting to a default of seconds.

Bob Phillips
08-23-2007, 01:03 AM
It is nothing to do with Wait, although the statement about seconds is correct, but to do with the value passed to TimeValue.

Just because it is being passed 0001 seconds that is not less than one second or more, it is still 1 second with many (irrelevant) leading zeroes.

To demonstrate this, type
?TimeValue("0:00:0001")
and it will return
TimeValue("0:00:01")

Similarly,
?TimeValue("0:00:1")
returns
TimeValue("0:00:01")

paulked
08-23-2007, 08:44 AM
Many thanks for explanation.

Best regards

Paul Ked