This library allows simple read/write access to files in a manner similar to that provided by some other 4GL vendors.
13.2.1 Dependencies
None
13.2.2 Function list
open_file(handle,filename,flag)
opens a file and associates ’handle’ as a name for that file. flag is
’u’ - use standard input/output
’r’ - readonly
’w’ - writeonly
’a’ - append
open_pipe(handle,cmd,flag)
runs a command and allows reading/writing to that command via a pipe. flag is
’u’ - input and output (*not implemented)
’w’ - write only
’r’ - read only
’a’ - write only (*append is identical to ’write only’ in this context)
set_delimiter(handle,delimiter)
This sets the default field separator for a file
close(handle)
This closes the handle and associated file
fgl_read(handle,nvars)
This reads from a file and returns each field as a separate return value. The number of values returned will therefore depend in the number of fields on each line of the file. This function is not part of the current implementation. As has been superceded by the ’read’ function.
read(handle,variable)
or
read(handle,[variable list])
This reads the fields from the file (separated by the delimiter) and put that data into the variables passed to the read function.
eg. read("file",[var1,var2,var3])
write(handle,variable)
or
write(handle,[variable list])
eg. write("file",[var1,var2,var3])
This writes the data passed in to the specified file.