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

Summary:
If you use the Cicode function FileOpen(Name, Mode) with the Mode option "a", then the Help states that if the file does not exist it will be created. However, if a folder, for example "Data" is given in the path name of the "Name" parameter as shown below, and the folder does not exist, then the function will return -1 as if it cannot open the file.

File=FileOpen("C:\Data\Report.Txt","a"); 
 

Solution:
Make sure that you create all the directories first that are in the path name that you have given in the "Name" parameter before using the Cicode function FileOpen(Name, Mode).
 

Keywords:
FileOpen  

Attachments