Frank Heckenbach wrote:
CBFalconer wrote:
... snip ...
Just as an example, one of my systems in bygone years did screen updates. The file was defined as a FILE OF RECORD .... where the record included a 24x80 array of char and a "cursorlocation" x y pair. The main program could examine and alter these fields in f^ as it desired, and then execute "put(f)", which did the actual transmission.
There was then no difference in the code running an external terminal on a serial line, and that running a memory mapped display. There was a great difference in the drivers, which were mapped into the actual file system via a set of tables for such things as open, close, put, get, status.
Close and status (what does this do?) are non-standard, BTW ...
Close is automagically called when the file variable goes out of scope. Status allows the runtime system to implement interrupt driven code. Just as examples. open is called via the reset and/or rewrite functions.
As I said, this sounds rather inefficient to me. The driver would have to partly undo your work (you want to write a string, you map it to character writes, possibly in different lines, perhaps interspersed with attributes, then the driver recoginizes sequential writes, with the same attributes if applicable, and turns it back into a sequential string output.
Depends on what you want. The point is that the Pascal file system has the capability of mapping many things in a system independant manner.