01-23-2024, 06:52 PM
In the wiki under _MEM is this:
TYPE memory_type
OFFSET AS _OFFSET 'start location of block(changes with byte position)
SIZE AS _OFFSET 'size of block remaining at offset(changes with position)
TYPE AS _OFFSET 'type description of variable used(never changes)
ELEMENTSIZE AS _OFFSET 'byte size of values inside the block(never changes)
IMAGE AS LONG 'the image handle used when _MEMIMAGE(handle) is used
SOUND AS LONG 'the sound handle used when _MEMSOUND(handle) is used
END TYPE
I'm interested in using SIZE to determine how much of the memory block is left to process, if that's possible.
I'm getting an image's memory location:
MemBlock = _MEMIMAGE(ImageHandle)
Then getting its offset:
Offset = MemBlock.OFFSET
Then iterating through the memory block:
DO
_MEMGET MemBlock, Offset, Pixel
'other code here
_MEMPUT Memblock, Offset, Pixel
Offset = Offset + 4
LOOP UNTIL MemBlock.SIZE = 4 ' (or perhaps 0?)
However MemBlock.SIZE never changes in value as I navigate through the memory block. What does the wiki mean by stating " size of block remaining at offset(changes with position) "?
Any help would be appreciated. I'm delving into the MEM statements and making great progress but this has me baffled.
TYPE memory_type
OFFSET AS _OFFSET 'start location of block(changes with byte position)
SIZE AS _OFFSET 'size of block remaining at offset(changes with position)
TYPE AS _OFFSET 'type description of variable used(never changes)
ELEMENTSIZE AS _OFFSET 'byte size of values inside the block(never changes)
IMAGE AS LONG 'the image handle used when _MEMIMAGE(handle) is used
SOUND AS LONG 'the sound handle used when _MEMSOUND(handle) is used
END TYPE
I'm interested in using SIZE to determine how much of the memory block is left to process, if that's possible.
I'm getting an image's memory location:
MemBlock = _MEMIMAGE(ImageHandle)
Then getting its offset:
Offset = MemBlock.OFFSET
Then iterating through the memory block:
DO
_MEMGET MemBlock, Offset, Pixel
'other code here
_MEMPUT Memblock, Offset, Pixel
Offset = Offset + 4
LOOP UNTIL MemBlock.SIZE = 4 ' (or perhaps 0?)
However MemBlock.SIZE never changes in value as I navigate through the memory block. What does the wiki mean by stating " size of block remaining at offset(changes with position) "?
Any help would be appreciated. I'm delving into the MEM statements and making great progress but this has me baffled.