--- Ritesh wrote:
> 
> int iIntegerData = 0 ;

Don't use int.  Always use the Palm data types.

> // this line works perfect, I get the integer value
> iIntegerData = StrAToI(queryElem.sFieldData ) ;

Not so perfect.  StrAToI returns an Int32 (4 bytes) but you assign this
to an int (usually 2 bytes on Palm OS) which can cause data loss.

> byFieldData  = new UInt8 [sizeof( int )] ;  // Allocation for

This creates an array of 2 UInt8s (or 4, depending on your compiler
settings).

> // 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.

I find that surprising.  If iIntegerData is <= 255, byFieldData[0] will
be 0 and byFieldData[1] will contain the expected number.


__________________________________________________
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/

Reply via email to