realbasic-nug
[Top] [All Lists]

Re: 32-bit unsigned quantity

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: 32-bit unsigned quantity
From: Stuart Malin <stuart at zhameesha dot com>
Date: Thu, 30 Dec 2004 21:48:12 -0800
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <CF3E4010-5ADA-11D9-98D1-000D9332E452 at netbox dot com>

On Dec 30, 2004, at 7:19 PM, Ken Fleisher wrote:

Is the offset a multiple of 4?
I had the problem recently. Was reading/writing from/to offset 2, I
think, and as soon as I changed that to 4 (and 8, and ...) it
worked...

Sometimes yes and sometimes no. The offset is simply where the 4-byte data begins. I don't have control of that. I have to take the data from where it is.

As Norm asked, the critical question is: how did the value get into the memory block in the first place? That will affect the order the bytes are in.

You could look at the 4 bytes you have using the .byte method -- and see if there is any order they could be put into that would yield an unsigned number of the value you expect. Doing so could give you an insight into how the bytes are ordered (endian-ness).

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>