PokeLong - Write a LONG value to a memory address

Top  Previous  Next

Syntax

 

<nByte> := PokeLong( <nAddress>, <nLongValue> )

 

Parameters

 

<nAddress>

 

Memory address to write to. The address is a  LONGvalue.

 

<nLongValue>

 

The value to write to memory starting at <nAddress>. It must be a LONG value.

 

Return value

 

Always NIL.

 

Description

 

PokeLong writes a LONG value directly to memory starting at a given address. Your program must have write access to the given memory address and the following 3 bytes.

 

Classification

 

Core

 

Category

 

Pointers and Memory

 

Quick Info

 

Library: cckptcor.lib / cckptcor.dll

 

See also

 

PeekLong, Peek, Poke

 

Example

 

 

#INCLUDE "CockpitCoreLibs.ch"

 

FUNCTION Main

 

LOCAL address

 

* Allocate some memory

address := LockNullString(4)

 

* Write some data

PokeLong(address,-123456789)

 

* Check if everything worked fine

? PeekLong(address)

 

RETURN NIL