Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
WAIT Statement Details
◄Summary► ◄Details► ◄Example► ◄Contents► ◄Index► ◄Back►
──────────────────────────────────────────────────────────────────────────────
WAIT portnumber, and-expression% [,xor-expression%]
Usage Notes
■ The WAIT statement is an enhanced version of the INP function; it
suspends execution until a specified bit pattern is input from an input
port:
• The data byte read from the port is combined, using an XOR operation,
with xor-expression%. If xor-expression% is omitted, it is assumed to
be 0.
• The result is combined with and-expression% using an AND operation.
• If the result is zero, the first two steps are repeated.
• If the result is nonzero, execution continues with the next program
statement.
■ 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 or "cold boot" the machine.
■ The following program line illustrates the syntax of the WAIT statement:
WAIT HandShakePort, 2
■ WAIT causes Visual Basic to do an AND operation on the bit pattern
received at MS-DOS I/O port HandShakePort with the bit pattern
represented by 2 (00000010).