Hello,

I was trying a big-endian / little-endian conversion.

In web I found this C function:

   ((word>>8) & 0x00FF) | ((word<<8) & 0xFF00)

 word is a  " 16bit "  value.


Well,

I translated that function in Gambas:

    Print Hex((Shr(&2301, 8) And &00FF) Or (Shl(&2301, 8) And &FF00))

I was waiting for this value:   01 23

but I do not understand why I obtain this results:  23 01 23


Where do I make the mistake ?

Thanks

vuott

------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to