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...
--
dda
On Thu, 30 Dec 2004 20:10:27 -0500, Ken Fleisher <PT_Ken at netbox dot com>
wrote:
> Hi again. Sorry for all of the questions that may seem simple to you
> (I've been away from programming for a while and just can't seem to get
> over these stumbling blocks...)
>
> I am reading in data (from a memoryblock) that is 4-bytes long and it
> is supposed to represent an unsigned, 32-bit quantity. I am reading the
> bytes as:
>
> memoryblock.Long( offset )
>
> but whether I put it into an integer, single, or double, I don't get
> the right value. (I'm expecting a value of 50, but I am getting
> something in the 700,000's. I'm not sure how to go about interpreting
> this quantity and all attempts at bitwise stuff have failed (my
> inexperience, no doubt!).
>
> Any advice will be appreciated!
>
> Thanks again.
>
> Ken Fleisher
_______________________________________________
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>
|