Keywords: pame

Subsections

- Exercises

# Other transput procedures

The procedure `idf` has the header

       PROC idf=(REF FILE f)[]CHAR:

and yields the identification of the book handled by the file `f`.

There are two other ways of closing a file. One is `scratch` and the other is `lock`. Here are their headers:-

       PROC scratch=(REF FILE f)VOID:
       PROC lock=(REF FILE f)VOID:

The procedure `scratch` deletes the file once it is closed. It is often used with work files. The procedure `lock` closes its file and then locks it so that it cannot be opened without some system action. In the QAD transput supplied with the a68toc compiler, `lock` removes all permissions from the file so that it cannot be accessed without first using the program `chmod`.

## Exercises

9.18
  Write a program to print the rainfall figures given in an earlier exercise. Start your report with a suitable heading. Ans
9.19
  Write a program which will read a text file and print each line preceded by a line number. Ans