WAIT Statement Details Syntax WAIT portnumber,and-expression[,xor-expression] Argument Description portnumber An integer expression in the range 0-255 that is the number of the port and-expression An integer expression combined with data from the port through an AND operation xor-expression An integer expression combined with data from the port using an XOR operation The WAIT statement suspends execution until a specified bit pattern is read from a designated input port. The data read from the port is combined, using an XOR operation, with xor-expression, if it appears. The result is then combined with the and-expression using an AND operation. If the result is zero, BASIC loops back and reads the data at the port again. If the result is nonzero, execution continues with the next statement. If xor-expression is omitted, it is assumed to be 0. ----- Warning ----- It is possible to enter an infinite loop with the WAIT statement if the input port fails to develop a nonzero bit pattern. In this case, you must manually restart the machine. ------------------- The following example program line illustrates the syntax of the WAIT statement: WAIT HandShakePort, 2 This statement will cause QuickBASIC to do an AND operation on the bit pattern received at DOS I/O port HandShakePort with the bit pattern represented by 2 (00000010).