***UPDATE - SOLVED
I should have done some more digging. I had to specify FILE_ANSI as a file open paramter.
error when reading file.txt!! why print a txt in Japanese?
I'm trying to read some numbers from a .txt file which is opened in the OnTester() function. The file appears to be opened correctly but when the variables are read they display strange characters instead of the number. The code, input file and result is shown below:
Any ideas would be appreciated. Thanks
int inputFileHandle = INVALID_HANDLE;
//string inputFileName = "TEST DATA\\DrawDown Test Data.txt";
string inputFileName = "TEST DATA\\Test.txt";
inputFileHandle = FileOpen(inputFileName, FILE_READ|FILE_TXT);
// READ DATA INTO ARRAY
int count = 0;
// RESIZE ARRAY
string str = FileReadString(inputFileHandle);
testDataBalance[count - 1]= StringToDouble(str);
double valStart = testDataBalance;
double valEnd = testDataBalance[count - 1];
I only use the Editor for compiling/debugging. I use Notepad2 with code folding.
Notepad can only display ANSI files. NP2 can display and convert to and from Unicode.
Consider replacing your Notepad
I have just downloaded Notepad++
Please enable the necessary setting in your browser, otherwise you will not be able to log in.