nxc

Negative values returned from file in NXC

痞子三分冷 提交于 2019-12-04 05:48:00
问题 I am saving values to a .csv file in NXC(Not eXactly C) and then calling on them ata later point in time. The problem I am having is when calling any negative values back from a cell it is displayed as 0123 instead of -123 which is throwing all my additional calculations off. The current code is: OpenFileRead("map.csv", fSize, count); until (eof == true) { ReadLnString(count, val); int lstFwd = StrToNum(val); NumOut(0,LCD_LINE1,lstFwd); } while(true); Can anyone explain how to rectify this

Negative values returned from file in NXC

家住魔仙堡 提交于 2019-12-02 10:15:18
I am saving values to a .csv file in NXC(Not eXactly C) and then calling on them ata later point in time. The problem I am having is when calling any negative values back from a cell it is displayed as 0123 instead of -123 which is throwing all my additional calculations off. The current code is: OpenFileRead("map.csv", fSize, count); until (eof == true) { ReadLnString(count, val); int lstFwd = StrToNum(val); NumOut(0,LCD_LINE1,lstFwd); } while(true); Can anyone explain how to rectify this issue as it is causing me a great deal of stress now. StrToNum should convert negativ numbers. Its a bit