ReadMemory - Read data from memory into a string

Top  Previous  Next

Syntax

 

<cString> := ReadMemory( <nLongStartAddress>, <nByteCount> )

 

Parameters

 

<nLongStartAddress>

 

A LONG value specifying the start address of the data to be read from memory.

 

<nByteCount>

 

Number of bytes to read from memory.

 

Return value

 

A string containing the data read from memory.

 

Description

 

ReadMemory reads a block of bytes from memory into a string. The start address of the block is given in <nLongStartAddress> and its size is specified by <nByteCount>. Make sure the address is correct and the byte count does not exceed the actual length. Otherwise you might face unpredictable results.

 

Classification

 

Core

 

Category

 

Pointers and Memory

 

Quick Info

 

Library: cckptcor.lib / cckptcor.dll

 

See also

 

WriteMemory

 

Example

 

 

#INCLUDE "CockpitCoreLibs.ch"

 

FUNCTION Main

 

LOCAL address

 

* Put some data in memory

address := LockString("Here we go")

 

* Read the data directly from memory

? ReadMemory(address,10)

 

RETURN NIL