Nope. The ByteArrayToXXX routines handle byte-swapping for you, and from
memory should handle all the standard integer types.

Exactly which types are you storing on the Palm? There was some discussion a
few days ago about this I think. If you are storing DateType structures
(which are a 2-byte bitfield) you'll have to resort to bitshifts to extract
it. Not too hard though. Something like this might work. NB: I haven't tried
this - and I'm not a VB expert! :-)

    'typedef struct {
    'UInt16 year  :7;
    'UInt16 month :4;
    'UInt16 day   :5;
    '} DateType;

    Dim month As Integer, day As Integer, year As Integer

    day = theMatchRecord.matchDate And &H1F
    month = (theMatchRecord.matchDate And &H1E0) \ &H1F
    year = ((theMatchRecord.matchDate And &HFE00)) \ &H200

Also you might get a better response over at the conduits list - that's
where all those wierd conduit developers hang out! :-)


Have fun,

Gavin.

-----Original Message-----
From: Michael Glickman [mailto:[EMAIL PROTECTED]]
Sent: Monday, 14 January 2002 11:37 AM
To: Palm Developer Forum
Subject: RE: Reading Date & Number fields from Byte Array




-----Original Message-----
From: K.S. Jaishankar [mailto:[EMAIL PROTECTED]]
Sent: Sunday, 13 January 2002 10:43 PM
To: Palm Developer Forum
Subject: Reading Date & Number fields from Byte Array


> I have difficulties in reading database fields of type 
> Date and Currency/Double/Single/Long/Int to synchronize the ODBC database.
I 
> have tried to use ByteArrayToBSTR, ByteArrayToDWord and ByteArryToWord 
> functions for converting them, however was not successful in getting date 
> and numeric values.

As a matter of fact, Palm fields are big-enfdian, while Intel has a
little-endian architecture. I do not design conduits (well, until we get a
documentation on pilot-link libraries :=)), but you might need calling ntohs
and htonl to swap byte order.

Michael

-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/

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