Applies To:
  • CitectSCADA 5.xx, 6.xx, 7.xx

If a file that is opened using the FileOpen Cicode function does not have a carriage return at the end of it, the FileEOF Cicode function will fail (Error Code: 275) when it reaches the end. Consequently, the Cicode function that had called it will halt. What can I do to get around this? 

You can easily get around this by first calling ErrSet(1) to enable user error handling before calling your WHILE loop with FileEOF. Then, once the loop has completed, you can turn off user error handling by setting ErrSet(0). You can either leave it as is and therefore ignore this error message, or you can log a warning in the syslog.dat file for any files that don't have a carriage return by adding the following Cicode after your FileEOF call:

iErrorCode = IsError();

IF iErrorCode = 275 THEN

    ErrLog("WARNING: No carriage return at the end of " + sString);


Note: The above assumes that you have defined an INTEGER variable called iErrorCode and a STRING variable called sString containing the path of the file that you have opened via the FileOpen Cicode function.