next up previous contents index
Next: General Data Set Up: MIRIAD Subroutine Library Previous: Error Handling

Text I/O

  Though standard Fortran-77 routines would appear to be adequate for text i/o, there are invariably minor differences between systems, mainly related to carriage control. Additionally placing them in a module of routines forces the programmer to follow the `handle' convention.
      subroutine output(text)
      subroutine txtopen(handle,name,status,iostat)
      subroutine txtread(handle,text,length,iostat)
      subroutine txtwrite(handle,text,length,iostat)
      subroutine txtclose(handle)
Output prints text (a character string) on the users terminal.

Txtopen opens a text file (passing back a handle) with name name. Status can be either 'old' or 'new'. When opening a new file, any old files which exist with the same name may be deleted. Txtread and txtwrite read and write a character string, text, of length characters. Length is passed back from txtread, whereas it is passed into txtwrite. It may be zero in either case. All these routines return an i/o status variable, iostat.

Txtclose closes the file.


Last generated by rsault@atnf.csiro.au on 14 Mar 1996