BinaryPoke

Pokes a new value into a binary buffer at offset returning the previous value.

 

Syntax for BinaryPoke Functions:

BinaryPoke( handle, offset, value )  Pokes an 8 bit value.

BinaryPoke2( handle, offset, value )  Pokes a 16-bit value.

BinaryPoke4( handle, offset, value )  Pokes a 32-bit value.

BinaryPoke8( handle, offset, value )  Pokes a 64-bit integer or huge number value.

BinaryPokeFlt( handle, offset, value )  Pokes a 64 bit floating point number.

Parameters:

(i) handle: handle of buffer.

(i) offset: zero-based offset in the buffer to obtain byte from.

(i) value: value to store.

Returns:

(i)  previous value.

 

This function pokes a value into the binary buffer at the offset specified.

Example:


binbuf=BinaryAlloc(10)
BinaryPoke( binbuf, 5, -14 ) ;Pokes a new value into the buffer.
a=BinaryPeek( binbuf, 5 ) ;Finds the value of a byte.
Message("Hmmm", "Returned value is %a%" )
; Value will be 242 which is (256 - 14). 242 and -14 map
; to the same 8bit number.
See Also:

Binary Operations, BinaryCopy, BinaryIncr, BinaryPeek, BinaryPeekStr, BinaryPokeStr