Good News Everybody!
The new search engine is LIVE!
Please report any problems to david (at) midrange.com.
|
On Mon, 2004-02-09 at 21:59, srilaxmi@xxxxxxx wrote:
> I understood what you are saying. My problem is the third party(PC) they do
> not want to do the bytes swapping, so my end (On AS/400) need to do the
> swapping and send.Is there any other way to do the bytes swapping on
> AS/400.
Uh, of course. You are sending a bunch of bytes through the socket
to the other end, nothing more. Try loading your numeric field into a
character array or alpha data structure and move things around as you see fit.
I just pulled my old MS-DOS C manual off the shelf, and I see that there is a
swab
(swap bytes) api call. If you really must have an AS/400 api call, this might
be it.
I don't know if this is even in the AS/400 C runtime library -- sorry I was too
lazy
to look it up. Although it could work, it doesn't seem difficult to write one
in
RPG anyway.
Quote:
'The swab function copies n bytes of data from the buffer source to another
buffer
at dest, taking two adjacent bytes at a time and swapping their positions in
dest.'
Example:
swab("badc", result, 4); // result will be "abcd"
--
Regards,
Rich
Current Conditions in Des Moines, IA
Overcast
Temp 28.4F, Windchill 17.4F
Winds out of the West at 14mph
This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.