FWIW, htonl() and htons() are not directly available via VB. They would
have to be picked up from the appropriate winsock DLL. Depending upon
which Windows platform you are running on you would need to declare the
externals differently.
Also, there are some third party replacements for WinSock for ATM and
other specialty networks. In at least one of those cases, the 'n' is
also little endian, so hton basically does nothing (no endian swap).
-jjf
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 22, 2000 12:48 AM
To: Palm Developer Forum
Subject: RE: Creating PDB files
From: Fergal Moran
> Yes, the values in PDB files are big endian. An offset of 0x0000012c
> would be stored 00 00 01 2c, as opposed to 2c 01 00 00. An easy way
to
> Endian swap in VB is to read 1 byte at a time and use math:
> l = <read 1 byte>
> l = l * 256
> l = l + <read 1 byte>
> l = l * 256
> l = l + <read 1 byte>
> l = l * 256
> l = l + <read 1 byte>
> In C (and maybe VB) you can make the * 256 much faster by bit shifting
> (l <<= 8).
Or you could use htonl() and htons() which convert longs and shorts from
little to big endian
.F.
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html