My EA always compiled without any warnings, but recently decided to compile again and have been getting these warnings.
For the life of me, I cannot work out why as I'm storing the return value of the File* functions in the correct variable type and only
using those variables as int values in the rest of my code
void StoreOrderOpenPrice(string argFile, int argTicket, string argPair, int argType, double argPrice)
int handle = FileOpen(argFile, FILE_READ|FILE_WRITE|FILE_CSV, ',');
if(FileSize(handle) > 0)
FileSeek(handle, 0, SEEK_END);
if(handle < 0)
int recorded = FileWrite(handle, argTicket, argPair, argType, argPrice);
if(recorded < 0)
FileWrite returns a uint, not an int.
Also note that it returns zero in the case of an error, so your error reporting will not work correctly
Thx GumRaj all fixed, replaced " < 0 " with " == 0" for the error checking.
To add comments, please log in or register