PEEK


Gets the value of an arbitrary type at an address in memory

Syntax:
declare function Peek ( byval address as any ptr ) byref as ubyte
declare function Peek ( datatype, byval address as any ptr ) byref as datatype

Usage:
Peek( [ datatype, ] address )

Parameters:
address
The address in memory to get the value from.
datatype
The type of value to get. If omitted, ubyte is assumed.

Description:
This procedure returns a reference to the value in memory given by a memory address, and is equivalent to
*cast(ubyte ptr, address)
or
*cast(datatype ptr, address)

Note: When using Peek, the -exx compiler option does not add code for null-pointer checking (no nullity test on the value of address).

Examples:
Dim i As Integer, p As Integer Ptr
p = @i

Poke Integer, p, 420
Print Peek(Integer, p)
will produce the output:

420


Differences from QB:
See also:
Back to Memory Functions
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode