_OFFSETs are basically automatically resizing integers. On a 32-bit version of QB64, they’re 4 bytes in size and could (almost) be substituted and interchanged for LONG variables. On a 64-bit version of QB64, _OFFSETs are 8 bytes in size and could (once again, almost) be interchanged with _INTEGER64 variables.
As long as your offset values don’t exceed the limit of your variable type, and you don’t lose precision (like with SINGLE values after a certain point), you can (usually) use any variable type you want in code segments like you provided.
Now, if you noticed, I used *almost* and *usually* several times in those few paragraphs. That’s because QB64 doesn’t allow us to mix and match integers and offsets very nicely. You’re very likely to see error messages similar to “cannot convert OFFSET to other variable types”, so most of the time, when you know you need to deal with offsets directly, it’s best to just use offsets completely.
DIM I AS LONG
_MEMPUT M, M.OFFSET + I, ....
The above has no issues compiling, but try to mix offsets and a FOR loop sometime...
DIM I AS LONG
FOR I = M.OFFSET TO M.OFFSET + M.SIZE
^ The above here is just an error waiting to happen.