Section 13.1: Packages Up Chapter 13: Aubit4GL Packages Section 13.3: file 

13.2 channel

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

13.2.2.1 open_file

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

13.2.2.2 open_pipe

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)

13.2.2.3 set_delimiter

set_delimiter(handle,delimiter)
This sets the default field separator for a file

13.2.2.4 close

close(handle)
This closes the handle and associated file

13.2.2.5 fgl_read*

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.

13.2.2.6 read

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])

13.2.2.7 write

write(handle,variable)
or
write(handle,[variable list])
eg. write("file",[var1,var2,var3])
This writes the data passed in to the specified file.
 Section 13.1: Packages Up Chapter 13: Aubit4GL Packages Section 13.3: file