File handling predefined procedures and functions

FileCreate ( filename )

 

This function returns an integer bigger than (0) (the file handle) in case the file filename was created.

 

FileOpen ( filename )

 

This function returns an integer bigger than (0) ( the file handle) in case the file filename was opened for read/write.

 

FileWrite ( handle, str )

 

This function returns the number of bytes written to file, represented by handle, on writing string str.

 

FileWriteLn ( fhandle, str )

 

This function returns the number of bytes written to file, represented by fhandle, on writing string str. At the end of str the ansi characters (13) and (10) are appended (end of line).

 

FileRead ( fhandle, count )

 

This function reads count bytes from file with handle fhandle and returns them.

 

FileSeek ( fhandle, offsetbytes, mode )

 

This function seeks offsetbytes bytes to the file with handle fhandle. If mode is (0) the offset counts from the beginning of the file.

 

FileClose ( fhandle )

 

This procedure closes the file with handle fhandle.

 

DirectoryExists ( dir )

 

This function returns (1) if the directory dir exists, otherwise returns (0).

 

RemoveDir ( dir )

 

This function returns (1) if the directory dir is removed, otherwise returns (0).

 

ForceDirectories ( dir )

 

This function returns (1) if the directory dir (and all of its parents) is created, otherwise returns (0).

 

CreateDir ( dir )

 

This function returns (1) if the directory dir is created, otherwise returns (0).

 

GetCurrentDir()

 

This function returns the current directory.

 

SelectDir()

 

This function opens a dialog in order to select a directoy (or even created) and returns the directory name.

 

ReadIni ( inifile, section_name, field_name )

 

This function returns from the INI file inifile the field field_name of section section_name.

 

CopyFiles ( sourcedif, destdir, filename )

 

This procedure copies the file(s) filename from sourcedir to destdir. The filename can contain wildcards.

 

DeleteFiles ( dir, filename )

 

This procedure deletes the file(s) filename from dir. The filename can contain wildcards.

 

WriteIni ( inifile, section_name, field_name, val )

 

This procedure writes in the INI file inifile the field field_name of section section_name and gives the value val.

 

EditIniFile ( inifile, section_name, field_name, val, type )

 

Same as the procedure WriteIni. The type can have the values "string" or "integer".