
EXAMPLES
INPUT#X, WORD$
reads data from the file with channel X, starting at the byte
pointed to, and puts the data read into the variable WORD$.
PRINT#X,"MONDAY"
writes the string MONDAY to the file with channel X, starting at
the byte pointed to.
There is a summary of all the random access keywords at the back
of this guide.
Interlocks
The Econet filing system has a system of interlocks to prevent
two users performing conflicting random access operations on the
same file at the same time. The system is called multiple reader,
single writer; it has these effects:
■
once you have opened a file for reading (using OPENIN
in BASIC II), anyone — including you
— can open it or re-open it for reading but no-one can open
it for writing
■
once you have opened a file for writing (using OPENIN or
OPENOUT in BASIC I, or OPENUP or OPENOUT in
BASIC II) no-one — including you — can open it, load it or
save it.
If the system stops you opening a file, you will get an error:
Already open
Reading and writing groups of bytes
There is another way of reading and writing bytes, in which you
handle them in groups rather than one by one. This method is
faster, but more complicated. It uses the operating system routine
OSGBPB, which is described in the Econet Advanced user guide.
43