contents   index   previous   next



SElib.peek()

syntax:

SElib.peek(address[, dataType])

where:

address - the address in memory from which to get data, that is, a pointer to data in memory.

 

dataType - the type of data to get, or thought of in another way, the number of bytes of data to get. UWORD8 is the default.

 

return:

value - returns the data specified by dataType

 

description:

Reads or gets data from the position in memory to which the parameter address points. The parameter dataType may have the following values:

 

UWORD8   SWORD8   UWORD16   SWORD16   UWORD24

SWORD24  UWORD32  SWORD32   FLOAT32   FLOAT64

FLOAT80  (FLOAT80 is not available in Win32)

 

These values specify the number of bytes to be read and returned.

 

Caution. Routines that work with memory directly, such as this one, should be used with caution. A programmer should clearly understand memory and the operations of these methods before using them. ScriptEase does not trap errors caused by this routine.

 

see:

SElib.poke(), Blob get(), Clib.memchr(), Clib.fread()

 

example:

var v = "Now";

   // Display "Now"

Screen.writeln(v);

   // Get the "N"

var vPtr = SElib.pointer(v);

   // Get the address of the first byte of v, "N"

var p = SElib.peek(vPtr);

   // Convert "N" to "P"

SElib.poke(vPtr,p+2);

   // Display "Pow"

Screen.writeln(v);

 

// See usage in clipbrd.jsh, com.jsh,

// dde.jsh, ddesrv.jsh, and winsock.jsh

 


SElib.pointer()