WAIT

From QB64 Wiki
Revision as of 17:48, 19 October 2009 by imported>Cyperium
Jump to navigation Jump to search

The WAIT statement suspends program execution while monitoring a port.

The WAIT statement is often used to wait for the monitor's vertical retrace and either waits for the monitor's vertical retrace to begin or end.


General syntax: WAIT port, and-expression[,xor expression]

The and-expression is combined with the data at the port using the operational AND and only if the result is non-zero is the next statement executed.

if the xor-expression is used it is combined with the data from the port using the operational XOR, and then the result is combined using the value from the and-expression using operational AND.


Syntax for vertical retrace:

WAIT &H3DA, 8 ' finishes whenever the screen isn't being written to
WAIT &H3DA, 8, 8 ' finishes whenever the screen is being written to


  • Either statement can be used to try to reduce screen flickering.
  • If both statements are used, try changing the order.


See also: Scancodes(demo)


Navigation:

Go to Keyword Reference - Alphabetical

Go to Keyword Reference - By usage