MEMBLOCKS
Memory command example:
mymem=MakeMEMblock(11)
'Write some information to the memblock
PokeByte mymem, 0, 7
PokeShort mymem, 1, -3400
PokeInt mymem, 3, 28561200
PokeFloat mymem, 7, 3.141592
'Read the information and print it
ourbyte=PeekByte(mymem,0)
ourshort=PeekShort(mymem,1)
ourint=PeekInt(mymem,3)
ourfloat#=PeekFloat(mymem,7)
Text 10,10,ourbyte
Text 10,30,ourshort
Text 10,50,ourint
Text 10,70,ourfloat
DrawScreen
WaitKey
DeleteMemBlock
Frees previously reserved memory
Usage:
DeleteMemBlock mem_variable
ResizeMemBlock
Reserves more or less space for the given memblock, in bytes
Usage:
ResizeMemBlock mem_variable, new_size
MemCopy
Copies a memory area to another location. The first entry is at zero.
Usage:
MemCopy source_mem, src_position, dest_memory, dest_position, length
PokeByte, PokeShort, PokeInt, PokeFloat
Writes a byte (1 byte), a word(2 bytes), an integer(4 bytes) or a float(4 bytes, to a previously reserved memblock. The first position is at zero.
Usage:
Poke**** mem_variable, position, value
MakeMemBlock
Allocates memory and returns its handle. The return value is zero, if failed. The size is measured in bytes.
Usage:
mem_variable = MakeMemBlock (size)
MemBlockSize
Tells the size value which was used when the given memory block was created, i.e. the size of the memblock.
Usage:
size = MemBlockSize(mem_variable)
PeekByte, PeekShort, PeekInt, PeekFloat
Read a byte (1 byte), a word (2 bytes), an integer(4 bytes) or a float (4 bytes), from a valid memblock. The first position is at zero.
Usage:
Peek**** (mem_variable, position)