The write command is used to writing data to a file its write data of any type to a file if open in the output or Append mode.
Write # int File Number, [expression list]
Int FILE NUMBER
A file number associated with the file open with the output.
Expression list contain those data value which are return to a file.
Write#3[Ayesha, Aniqa, Ali]
Write#3Ayesha, Aniqa, Ali (no bracket)
To read data from an open file following commands are used.
USING INPUT #
Input # reads data from files and stores the data in programs variables and control.
Inut # int File number [expression list]
Input#3 Ayesha, Aniqa, Ali,..…,….
LINE INPUT #
Line input # reads data from open data files line input # requires a single string value line input # reads data from any file whole line end with carriage rerun.
Line Input # int File number, Str variable Name
USE OF EOF ()
When reading data from a file, programmer can easily cause an error by attempting to read more data then the file code.
EOF (int File Number)