Applies To:
  • CitectSCADA 7.0
  • CitectHMI 7.0


The FormSaveAsFile() Cicode function is used to allow the user to select a path and filename for Cicode to create and write to. The user can select the type of file to display in the browse dialog (e.g. DBF, CSV, TXT). However, this extension is not appended to the filename the user enters if an initial path was passed to FormSaveAsFile(). As a result, the Cicode cannot tell which file type the user selected.



The extension is correctly appended if no path was passed to FormSaveAsFile. If an initial path is desired, a work-around is to enter an extension in the optional sDefExt argument. If the user enters a filename with no extension, the extension of the selected file type will be appended. For example, if dBase III was selected, .DBF would be appended to the file name. If the user selected a choice with no extension, for example All Files (*.*), the first 3 letters of the sDefExt value would be used as the extension. For example:

sPath = "c:\logfiles\";
sDefExt = "csv";
sTypes = "dBase III (*.dbf)|*.dbf|Csv Files (*.csv)|All Files (*.*)|*.*|";
sFile = FormSaveAsFile("Save As", sPath, sTypes, sDefExt);