On Jan 19, 2007, at 7:03 AM, James Sentman wrote:

Hi Folks,

I finally upgraded my RB IDE to begin building universal versions of things and I'm running into issues with memory blocks and endian problems. Specifically for data that was stored in binary files and for binary network protocols between a PPC and an Intel Macintosh.

I can get some things to work by simply setting the littleendian property of the memory blocks I use to build the packets to false on the Intel build. But that doesn't seem to solve all the problems. What other things are affected by endianness? String set via the stringvalue command in a memory block seem to be unaffected. Are there some things that aren't set properly by simply setting the littleendian property to false?

Because strings are treated as binary data, REALbasic does not know how to swap strings when assigning them to memoryblocks. If you're using UTF-16 strings, this could be a problem because the strings need to know what endinanness they are, and may require manual swapping.

The items that need to be swapped are all the integer types. The MemoryBlock will automatically swap these values for you, if you properly set the LittleEndian flag. Any strings that need to be dealt with are up to you to let REALbasic know what encoding they are.

HTH,
Jon


--
Jonathan Johnson
[EMAIL PROTECTED]
REAL Software, Inc.

REAL World 2007 Conference
May 9 - 11 in Austin, Texas
<http://www.realsoftware.com/realworld>

_______________________________________________
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>

Reply via email to