Rpbasic-52 programming guide, Peek – Remote Processing BASIC 52 User Manual
Page 100

RPBASIC-52 PROGRAMMING GUIDE
2-81
PEEK$
Syntax:
$(n) = PEEK$( segment,ad dress)
Where: segment = 0 to 7, specifies a 64K segment
address = 0 to 65535, starting string address in a segment
Function:
R e tr ie v es a s tr in g fr om R A M .
Mode:
Comm and, Run
Use:
$(0) = PEEK$(1,210)
Cards:
All
D E S C R IP T I ON
Use th is com man d to retri eve str ings sto red in R AM mem ory usin g the P OK E$ co mm and. segment specifies
the 64K segment to save to. 0 is the base segment where RPBA SIC-52 runs its programs. Setting MTOP to a
number less than the top of memory will provide a 'protected' area from the Basic program.
Refer to the POKEB statement for addressing and segment information.
NOTE: T h i s c o m m a nd w o rk s on l y w h e n it i s a s si g ni n g a n o th e r s t ri n g v a ri a bl e . A B A D
SYNTA X error is returned when it is part of a PRINT, IF-THEN, ASC, or other command
or function. Use this function only as shown in SYNTAX above.
RELATED
POKE$
ERRORS
B A D S Y N T A X If $, segment, or address is missing. Also when this function is part of
another function or command.
BAD DATA
If segment is > 7
EXAMPLE
The following example assumes MTO P = 30000. It will assign and recover a string from
R A M .
10 AD = 30000
20 STRING 100,20
30 $(0) = "Test string"
40 POKE$ 0,AD,$(0)
50 $(1) = PEEK$(0,AD)
60 PRINT $(1)