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: dda <headspin at gmail dot com>
Date: Fri, 31 Dec 2004 03:25:32 +0100
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=M2tVJ1NPKuAYCbxJqUhO5vSlK9S4l/1CHiNRIz5Dv+UypEowJU5tZLIBAMR7IQndsGYgmofU+/QmlgyW4nejyEIQ9P/MV8teIMQwn3gPPWYrN3nMqh1jK1bLTNK3DdflLyjH1U2NnYT2HvFKqpna5Ps8J+dbAXP1ooYomcuvuKw=
References: <20041230235329 dot 3D33C62972C at lists dot realsoftware dot com> <C1B04B31-5AC8-11D9-8E47-000D9332E452 at netbox dot com>
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>

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