QBasic 1.1: PEEK Function
Explanation
PEEK Function, POKE Statement
PEEK returns a byte value stored at a specified memory location.
POKE writes a byte value to a specified memory location.
Worth knowing
Useful and cross-version information about the programming environments of QBasic, QuickBasic and Visual Basic for DOS.
Syntax
PEEK(address) |
POKE address,byte% |
Description / Parameter(s)
address |
A byte position relative to the current segment address set by DEF SEG; a value in the range 0 through 65,535. |
byte% |
A byte value to write to the specified memory location; a value in the range 0 through 255. |
Example
DEF SEG = 0
Status% = PEEK(&H417) 'Read keyboard status.
POKE &H417, (Status% XOR &H40) 'Change Caps Lock state, bit 6.