POKE
Syntax
Section titled “Syntax”poke <address>, <value>poke <type> <address>, <value>
Description
Section titled “Description”Stores the given (numeric) value at the specified memory address. If valueType is omitted, it is supposed to be ubyte (8 bit unsigned integer).
The value is converted to the given valueType and stored at the given Address. Type can be any numeric one (like float or integer).
Examples
Section titled “Examples”It is possible to poke a decimal value (5 bytes) at a memory position:
poke float 16384, pi
Traditionally, in Sinclair BASIC, to store a 16 bit value the programmer does something like this:
10 LET i = 1638420 LET value = 6550030 POKE i, value - 256 * INT(value / 256) : REM value MOD 25640 POKE i + 1, INT(value / 256)
This can be done in a single sentence in ZX BASIC:
poke uinteger 16384, 65500
It’s faster and the recommended way.
Remarks
Section titled “Remarks”- This statement is Sinclair BASIC compatible.
- This statement extends the Sinclair BASIC one.
- This statement also allows parenthesis and FreeBASIC syntax