PRB: MessageBox() or InputBox() with Timeout Under One Millisecond Never Times Out (305045)



The information in this article applies to:

  • Microsoft Visual FoxPro for Windows 7.0

This article was previously published under Q305045

SYMPTOMS

A MessageBox() or InputBox() function with a timeout parameter less than one millisecond may never time out.

CAUSE

Because both functions use milliseconds as their timeout parameter, any number that is less than one is treated as a zero. For example, using 0.5 as the timeout parameter causes InputBox or MessageBox to display indefinitely because the value is treated as a zero.

RESOLUTION

Use a timeout parameter that is greater than or equal to one.

STATUS

This behavior is by design.

MORE INFORMATION

To reproduce the behavior, type either of these lines in the Command window:
=INPUTBOX("Hello world","Hey there! ","",0.5)
=MESSAGEBOX("Hello world", 0, "", 0.5)
				
Note that neither window times out; both windows remain on the screen indefinitely.

Modification Type:MajorLast Reviewed:8/31/2001
Keywords:kbCodeSnippet kbDSupport kbprb KB305045