Usage
Reads a string from memory.
Syntax
var$ = PeekString$(
Parameters
<address>
: UNSIGNED, memory address to read from.Unicode
: Optional parameter. Keyword indicating that the returned string uses Unicode encoding.
Return value
var$
: String. If an error occurs, script execution stops.
See also
Examples
Example code
' memory address
dim pointer as unsigned
' memory allocation
pointer = allocate(64)
' prepare a variable for the return value
wdir$ = " "
' write the blank string to memory
ret = PokeString(pointer, wdir$, 0)
' In Win32, an A must be added to functions returning an ASCII string
a = External("kernel32", "GetWindowsDirectoryA", pointer, 64)
' read the string at the given memory address
var$ = PeekString$(pointer)
msgbox(var$)
Example code using Unicode
' memory address
dim pointer as unsigned
' memory allocation
pointer = allocate(64)
' prepare a variable for the return value
wdir$ = " "
' write the blank string to memory
ret = PokeString(pointer, wdir$, 0)
' In Win32, a W must be added to functions returning a Unicode string
a = External("kernel32", "GetWindowsDirectoryW", pointer, 64)
' read the string at the given memory address
var$ = PeekString$(pointer, Unicode)
msgbox(var$)