If you take a look into the include file types.bm, then you will recognize
SUBs to define unsigned and signed integer types as well as single and double
precision floating point types and a couple others. These SUBs are made to
write your structures in the way of its intended use, but nevertheless all
SUBs just define the size of an entry. That is, you as programmer must make
sure to access the entries with the right PokeXX and PeekXX routines from
the include file memory.bm, and interpreting them as intended. There is no
safety net which prevents you from accessing a SINGLE entry as UWORD or
interpreting an ULONG as signed value nevertheless, so in fact there is
one major rule: The programmer knows what he's doing!
As with all variables, the offsets defined with these SUBs are only valid
in the scope they are defined in, hence you must exclusively SHARE the
offsets defined in the main module, if you use it in a SUB or FUNCTION.
Likewise, offsets defined from within a SUB or FUNCTION are local to this
SUB or FUNCTION unless they are SHAREd.
!! IMPORTANT !!
Make sure the variables you pass in as sym& to any of the DefXXX SUBs or
the enumerating SUBs are of type LONG, otherwise the compiler does create
a temporary LONG object for the call. This behavior would assign the
offset to the temporary object instead of your given variable and as the
temporary object is disposed after the SUB returns, your given variable
would remain blank.
Back to Types Overview