WRITING TO FILE

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.

SYNTAX

Write # int File Number, [expression list]

Int FILE NUMBER

A file number associated with the file open with the output.

EXPRESSION LIST

Expression list contain those data value which are return to a file.

EXAMPLE

Write#3[Ayesha, Aniqa, Ali]

Write#3Ayesha, Aniqa, Ali (no bracket)

READING FILE

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.

SYNTAX

   Inut # int File number [expression list]

EXAMPLE

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.

SYNTAX

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.

SYNTAX

Built-Inn function

EOF (int File Number)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s