<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css">
<title>
Gambas Documentation - WAIT
</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../help+en"><img class="flag" alt="Home" border="0" src="../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../lang+en">Up</a>&nbsp;
<a href="vardecl+en">Previous</a>&nbsp;
<a href="watch+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
WAIT
</h1>
<div class="black"><font size="-2"><b>Syntax</b></font></div>
<pre class="syntax"><b>WAIT</b> [ <u>Delay</u> ]</pre><p>

Calls recursively the event loop.
<p>
If <u>Delay</u> is specified, the function does not return until <u>Delay</u> seconds elapse.
<p>
If <u>Delay</u> is not specified, the functions processes every events and returns immediately.
In this case, keyboard and mouse events are ignored.
<p>
<div class="warning"><table class="none" border="0"><tr><td width="40" valign="top"><img border="0" src="../../img/info.png" align="center"></td><td valign="top">
<u>Delay</u> is a floating point number. So, if you want to wait 100 ms, just do: <tt>WAIT 0.1</tt>
</td></tr></table></div>
<p>
<div class="gray"><font size="-2"><b>Example</b></font></div>
<pre class="example">' Waits a little, letting the user interacts with the GUI
WAIT 0.1

' Waits, but the user can just watch what happens...
WAIT</pre>
<p>
<div class="warning"><table class="none" border="0"><tr><td width="40" valign="top"><img border="0" src="../../img/warning.png" align="center"></td><td valign="top">
If you call <tt>WAIT</tt> from an event handler, you may create infinite recursions.
</td></tr></table></div>
<p>
<hr><b>See also</b><br>
<a href="../cat/eventloop+en">Event Loop</a>&nbsp;

</div>
</body>
</html>

