Don
Thanks for the response. I tried 'unsigned short' with no improvement.
I have been bashing my head against the wall trying to solve this and still havent. Further info I found was:
I tired with positive values between about 3000 and 4000 to see if the negative was the root of the problem but it appears it is not.
Most values swap OK but these input values below produce the returns values.
Input Returns
3082 2566 2573 2567
3338 2812 2561 2573 2565
3593 2802 2803
3594 2803
Note the return results dont seem to be fully consistant bit similar eg 3082 returns three values 2566, 2573, 2567.
Also note the return values are actually swapped, then written to file, file closed and reopened and then I read them back. The writing to file might be something to do with the problem too. To write I use
-
short sElevation, mytest;
-
mytest = short((points[i].PropZ-pBenchmark[0].Z+10)/0.0025
-
sElevation = SwapShortWords(mytest);
-
iWriteReturn = write(gihFile, &sElevation,2);
-
-
What the heck is going on?