I need to convert little endian long integers(intel type) to Big Endian long integers (motorola type) - anybody any ideas - this basically involes switching the byte order of a 4 byte long ie. byte1-byte2-byte3-byte4 becomes 4-3-2-1.

I can do it if I write to a file as binary then read in as bytes then read out the bytes in reverse order, but this is a bit long-winded.

I need to be able to do it in a function.

TIA