Quote: "Quote: "In the case of a DWORD in a memblock, one can't directly write a 4 byte DWORD to a memblock. However, you can write 4 bytes 1 at a time."
Have you tested that you can't?"
Yes, but let me clarify, in the case of
Quote: "When used in dbc the value 0xFFFFFFFF comes out as -1, but the bits are all still set! So it can't be used for number operations, but anything you can still use it for"
you can't write a DWORD of 4 bytes to a memblock when bit 31 is set because the DBC expects the DWORD to be unsigned and DBC's integers are signed. If you keep the values up to (2^31)-1 then all 4 bytes can be written as a DWORD to the memblock.
ex:
make memblock 1,4
write memblock dword 1,0,-1
will cause an error
make memblock 1,4
write memblock dword 1,0,(2^31)-1
will work fine without setting bit 31 (though it is 4 bytes long)
And if we want to do it indirectly, we can write 4 bytes of value 255 to the memblock which will set bit 31 and read back the full DWORD as -1
make memblock 1,4
write memblock byte 1,0,255
write memblock byte 1,1,255
write memblock byte 1,2,255
write memblock byte 1,3,255
a=memblock dword(1,0)
print a
It's quirky that DBC will read back the DWORD with all bits set but it won't write it.
Sorry that I wasn't clear. I'll change it above so others aren't confused.
Enjoy your day.