Reading Binary Data in Little Endian Format

Dave dave at looktowindward.com
Tue Jan 8 06:45:33 EST 2008


Hi,

Yes, in the file it is stored as 0xBC000000, and it's little endian,  
so it's really 0x000000BC (188 decimal) I've looked at it with a Hex  
Dump utility. I need to return 188 as a number so I can then use that  
number in RunRev to read additional characters (the field is a length  
field and specifies how many bytes are contained in the section of  
the file).

All the Best
Dave


On 8 Jan 2008, at 11:34, Mark Schonewille wrote:

> Dave,
>
> Dit you investigate the actual binary data? Is it 0xBC000000 or  
> 0xCB000000? Perhaps the original number is 0x000000BC but should be  
> 0xCB000000? Is it really an 8 digit hex number?
>
> Best regards,
>
> Mark Schonewille
>
> --
>
> Economy-x-Talk Consulting and Software Engineering
> http://economy-x-talk.com
> http://www.salery.biz
>
> Quickly extract data from your HyperCard stacks with DIFfersifier.  
> http://differsifier.economy-x-talk.com
>
>
> Op 8-jan-2008, om 12:19 heeft Dave het volgende geschreven:
>
>> Hi,
>>
>> I've tried a few things, such as:
>>
>> put empty into myData
>> repeat 4 times
>> read from file myFile for 1 char
>> put it before myData
>> end repeat
>>
>> But this doesn't work - just returns 0.
>>
>> Not sure how to go about this in RunRev, although in C it was be  
>> sooooooooooooooooooooo simple!
>>
>> All the Best
>> Dave
>>
>> On 8 Jan 2008, at 11:13, Mark Schonewille wrote:
>>
>>> Hi Dave,
>>>
>>> You need to write a function to revert the numbers manually. I'd  
>>> say that's an easy task to do.
>>>
>>> Best regards,
>>>
>>> Mark Schonewille
>>>
>>> --
>>>
>>> Economy-x-Talk Consulting and Software Engineering
>>> http://economy-x-talk.com
>>> http://www.salery.biz
>>>
>>> Quickly extract data from your HyperCard stacks with  
>>> DIFfersifier. http://differsifier.economy-x-talk.com
>>>
>>>
>>> Op 8-jan-2008, om 12:08 heeft Dave het volgende geschreven:
>>>
>>>> Happy New Year to All!
>>>>
>>>> Does anyone know of an easy way to read a 4 bytes (32 bit)  
>>>> little endian number from a file?
>>>>
>>>> I am running on a Mac and the file I am trying to process  
>>>> *always* is stored in Little Endian Format, for instance:
>>>>
>>>> The number 0x00000000BC   (188) is stored in the file as:
>>>>
>>>> 0xBC000000 (a VERY large number!)
>>>>
>>>> I want to get 188 when I read these four bytes.
>>>>
>>>> Any ideas???
>>>>
>>>> Thanks a lot
>>>> All the Best
>>>> Dave
>>>>
>>>>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list