contents   index   previous   next



SElib.poke()

syntax:

SElib.poke(address, data[, dataType])

where:

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

 

data - data to write directly to memory. The data should match the dataType.

 

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:

number - the address of the byte after the data just written to memory.

 

description:

Writes data to the position in memory to which the parameter address points. The data to be written must match the dataType. 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 written to memory.

 

 

 

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.peek(), Blob put(), 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 bmp.jsh, clipbrd.jsh,

// dde.jsh, ddecli.jsh, and dropsrc.jsh

 


SElib.ShellFilterCharacter()