Poke Commands

Purpose

Writes a value in the specified data type to an address.

Syntax

Poke addr, byte

CharPoke addr, string

CPoke addr, card

CurPoke addr, currency

DPoke addr, short

DblPoke addr, double

LPoke addr, long

Poke$ addr, string

Poke8 addr, large

SngPoke addr, single

StrPoke addr, string

addr:address

Description

Writes a value to an address.

CharPoke, Poke$, and StrPoke write a null-terminated string to a memory address. Note that the memory must be large enough to strore the additional null.

Example

Debug.Show

Local a$ = Space(16), b$ = "ABCDEFGHIJKLMNOP" & Chr(0)

Trace b$

Poke V:a$, Byte{V:b$} : Debug "Poke V:a$, Byte{V:b$} -> ";a$ : a$ = Space(16)

CharPoke V:a$, CharPeek(V:b$) : Debug "CharPoke V:a$, CharPeek(V:b$) -> ";a$ : a$ = Space(16)

CPoke V:a$, Card{V:b$} : Debug "CPoke V:a$, Card{V:b$} -> ";a$ : a$ = Space(16)

CurPoke V:a$, Cur{V:b$} : Debug "CurPoke V:a$, Cur{V:b$} -> ";a$ : a$ = Space(16)

DPoke V:a$, Word{V:b$} : Debug "DPoke V:a$, Word{V:b$} -> ";a$ : a$ = Space(16)

DblPoke V:a$, Double{V:b$} : Debug "DblPoke V:a$, Double{V:b$} -> ";a$ : a$ = Space(16)

LPoke V:a$, Long{V:b$} : Debug "LPoke V:a$, Long{V:b$} -> ";a$ : a$ = Space(16)

Poke$ V:a$, b$ : Debug "Poke$ V:a$, b$ -> ";a$ : a$ = Space(16)

Poke8 V:a$, Large{V:b$} : Debug "Poke8 V:a$, Large{V:b$} -> ";a$ : a$ = Space(16)

SngPoke V:a$, Single{V:b$} : Debug "SngPoke V:a$, Single{V:b$} -> ";a$ : a$ = Space(16)

StrPoke V:a$, b$ : Debug "StrPoke V:a$, b$ -> ";a$

Remarks

The Poke functions have equivalent {}= versions, which can be used instead.

See Also

xx{}=, Peek Functions, PokeProcess Functions.

{Created by Sjouke Hamstra; Last updated: 24/08/2021 by James Gaite}