CitectVBA Programming Reference > CitectVBA Function Reference > File I/O Functions

File I/O Functions

CitectVBA file Input/Output (I/O) functions are provided to enable read and write disk file functionality.

The file I/O functions predefined in CitectVBA are:

ChDir

Changes the system environment current directory on the specified drive.

ChDrive

Changes the system environment current drive to the specified drive.

Close

Closes the file/s previously opened with the Open statement.

CurDir, CurDir$

Returns the current system environment path for the specified drive (Drv).

Dir

Returns a file or directory name that matches the given Fileand Attrib arguments.

EOF

Returns a boolean True or False value during file access that indicates whether the current position of an open file has reached the end of the file.

FileCopy

Copies a file from Src to Dest.

FileLen

Determines the byte length of a file.

FreeFile

Retrieves the next sequential system file number available for association with a file.

Get #

Reads data from a disk file into a variable.

GetAttr

Returns an Integer representing the attribute settings of a file, directory, or volume.

Input

Reads data from a Sequential file and assigns that data to variables. Input function returns characters from a file opened in Input or Binary mode.

Kill

Deletes files from disk.

Line Input #

Reads a single line from an open sequential file and assigns it to a String variable.

Loc

Returns a number indicating the current position within a file opened using the Open statement.

LOF

Returns a number indicating the byte length of a sequential file opened using the Open statement.

MkDir

Creates the directory specified in the Path parameter.

Name

Renames the disk file specified in the OldFileNameparameter, to the name specified in the NewFileName parameter.

Open

Enables input/output (I/O) to a disk file.

Print (function)

Displays a message in the CitectSCADA Kernel and the Cicode Editor output window.

Print #

Reads data from OutputList and writes that data to a sequential file.

Put #

Writes data from a variable to a disk file.

RmDir

Deletes the directory specified in the Path parameter.

Seek

Sets the current position within a file opened using the Open statement, ready for the next read or write action.

Write #

Writes data to a Sequential file opened in output or append mode and reads that data from a list of variables.