MemblockFloat

Family: Memblock · 2 forms

What it does

MemblockFloat takes memID (an integer) and offset (an integer), and answers a float. That is the first of 2 forms. memID is the id of a memblock, the one CreateMemblock returned: it is how the call knows what to act on.

Syntax

1
MemblockFloat(memID integer, offset integer) → float
2
MemblockFloat(memID integer, offset integer, value float)

Parameters

NameTypeIn forms
memIDintegerall
offsetintegerall
valuefloat2

What each form returns

1MemblockFloat(memblock, 1)float
2MemblockFloat(memblock, 1, 1.0)nothing

Example · generated

Form 1, the command hands back the id

memblock = CreateMemblock(64)DO  Print(MemblockFloat(memblock, 1))  Sync()LOOP

Form 2, you choose the id yourself

memblock = CreateMemblock(64)MemblockFloat(memblock, 1, 1.0)DO  Sync()LOOP

CreateMemblock is there to give the call something to act on; MemblockFloat is the line that matters. The DO … LOOP is not decoration: a classic BASIC program ends the moment it runs out of lines, and Sync() is what draws the frame.

43 commands in Memblock