Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!ubc-cs!!tacitus!clh From: clh@tacitus.tfic.bc.ca (Chris Hermansen) Newsgroups: comp.lang.pascal Subject: Another simple question (BSI/ISO Pascal) Message-ID: <115@tacitus.tfic.bc.ca> Date: 17 Oct 89 16:01:58 GMT References: <115@m1.cs.man.ac.uk> Reply-To: clh@tfic.bc.ca (Chris Hermansen) Organization: Timberline Forest Inventory Consultants, Vancouver BC Lines: 38 Perhaps one simple question deserves another... Does anyone care to offer an explanation/excuse as to why most Pascal implementors have totally screwed up the I/O? For example, adding the so-called `interactive' file type, file pointers that become undefined when there's actually something in the file, etc etc? The last I recall, a generally acceptable solution to implementing Pascal I/O was using `lazy I/O', as in: - reset(f): open the file and set flag indicating f^ needs filling - get(f): set flag indicating f^ needs filling - eof(f), eoln(f): fill f^ if necessary, reset flag, and check the condition - references to f^: fill f^ if necessary, reset flag, and do whatever So anyway, the beauty of this was supposed to be that segments of code like var c1, c2: char; f: text; ... reset (f); write ('Type a character '); readln(f,c1); write ('Type another character '); readln(f,c2); ... would `work as expected', without any hidden gotchas introduced by an interactive file type. I *think* this is the way Sun Pascal does it; T***o certainly doesn't, nor did Microsoft at the point I tried it (several years ago), nor did the P-system, nor the 370 Pascal compiler that UBC made while I was a student there. Any thoughts? Chris Hermansen Timberline Forest Inventory Consultants Voice: 1 604 733 0731 302 - 958 West 8th Avenue FAX: 1 604 733 0634 Vancouver B.C. CANADA uunet!ubc-cs!van-bc!tacitus!clh V5Z 1E5