I think that has to do with the big endian order that the m68k uses. iIntegerData is int, the first byte of it is stored at low address and the second byte is stored at high address.
When it is smaller than 255, the low address byte will be 0 and the high address byte is that number. If it is the opposite, the low address byte is not zero... So if you want to use byFieldData as string, you got the problem... Hope this helps. Max --- Ritesh <[EMAIL PROTECTED]> wrote: > Hi Gurus, > I know i am doing something hopelessly stupid here. Please Help me find it. > > All i want to do in following code is , to Convert a > char* (i.e. queryElem.sFieldData ) to and int(i.e. iIntegerData ), and then > keep that int > as a UInt* in byFieldData variable. > > int iIntegerData = 0 ; > > // this line works perfect, I get the integer value > iIntegerData = StrAToI(queryElem.sFieldData ) ; > > byFieldData = new UInt8 [sizeof( int )] ; // Allocation for byFieldData > > MemSet( byFieldData, sizeof( int ) , 0 ); // Clear the memory of > byFieldData > > // Copying the value to the Uint, > MemMove(byFieldData , &iIntegerData , sizeof( int ) ) ; > > What i observe here is: if the iIntegerData >= 255 , there is no problem, i > can see the value stored in byFieldData as the value that i need. but if > iIntegerData <= 255 , I Get blank in the byFieldData after I do MemMove. > Please Help. > > Ritesh > > > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please > see http://www.palmos.com/dev/tech/support/forums/ ===== http://www.weirdwww.com/ __________________________________________________ Do You Yahoo!? Send FREE Valentine eCards with Yahoo! Greetings! http://greetings.yahoo.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
