Peek is the complementary function to the poke statement.
option base 1 dim src%(50), dst%(50) srcoff% = varptr(src%) srcseg% = seg dstoff% = varptr(dst%) dstseg% = seg for i% = 1 to 100 10 def seg = srcseg% 20 temp% = peek(srcoff%) def seg = dstseg% poke dstoff%, temp% srcoff% = srcoff% + 1 if srcoff% = 0% then srcseg% = srcseg% + 1% dstoff% = dstoff% +1 if dstoff% = 0% then dstseg% = dstseg% + 1% next i%illustrates an unusual way of copying an array using peek. In line 20, peek is used to assign the value located at the address of src% to the temporary variable temp% after the def seg statement in line 10 has been used to correctly set the high-order bits of the source address.
Of course, there are better ways to copy arrays. This method is shown only to illustrate the peek function.
from The Basmark QuickBASIC Programmer’s Manual by Lawrence Leinweber