To suspend program execution while monitoring the status of a machine input port.
WAIT port number, n[,j]
port numberrepresents a valid machine port number within the range of 0 to 65535.
nand jare integer expressions in the range of 0 to 255.
The WAIT statement causes execution to be suspended until a specified machine input port develops a specified bit pattern.
The data read at the port is XORed with the integer expression j, and then ANDed with n.
If the result is zero, GW-BASIC loops back and reads the data at the port again.
If the result is nonzero, execution continues with the next statement.
When executed, the WAIT statement tests the byte n for set bits. If any of the bits is set, then the program continues with the next statement in the program. WAIT does not wait for an entire pattern of bits to appear, but only for one of them to occur.
It is possible to enter an infinite loop with the WAIT statement. You can exit the loop by pressing CTRL-BREAK, or by resetting the system.
If jis omitted, zero is assumed.
100 WAIT 32,2
Suspends machine operation until port 32 receives 2 as input.
All Frank Sinatra recordings, All Beatles albums, All solo albums from John Lennon, Paul McCartney, George Harrison and Ringo Starr, All Beatles songs, List of Platinum selling albums, Database with hits from 1950 to 1999.
Sought after DLL files, Nutworks magazine (retro), Worldwide ISO and TLD codes, File extensions database, The Hackers dictionary, Free software for the Atari, Amiga and Macintosh, Nokia smartphone, PocketPC, List of all BASIC programming language commands, List of all DOS commands, Free Advanced Bash-Scripting Guide (Linux-Unix)