qbasic.hlp (Topic list)
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.
PEEK Function, POKE Statement
  Contents  Index  Back
──────────────────────────────────────────────────────────────────────────────
PEEK returns a byte value stored at a specified memory location.
POKE writes a byte value to a specified memory location.
 
PEEK(address)
POKE address,byte%
 
    ■ 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.
 
See Also    DEF SEG