Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!unmvax!aplcen!haven!adm!xadmx!RDK%vm.temple.edu@cunyvm.cuny.edu From: RDK%vm.temple.edu@cunyvm.cuny.edu (Robert Keiser) Newsgroups: comp.lang.pascal Subject: Re: Standard Pascal Message-ID: <20239@adm.BRL.MIL> Date: 13 Jul 89 18:09:49 GMT Sender: news@adm.BRL.MIL Lines: 37 ok, I've been watching the current disscusion about read/write vs. get/put and I have a question. But first, let me tell you where I'm coming from. I've worked on a Cyber using U. of M. Pascal and on pc's using Turbo. On the Cyber's, to get interactive I/O to work correctly required you to first declare the file input to be interactive (by placing a '/' after the filename on the program statement (i.e. PROGRAM HELLO (INPUT/,OUTPUT);). The slash tells Pascal not to do the initial GET on input. Then to read anything, you first would have to issue a blank readln followed by your read. The code would look something like this: . . . WRITELN('WHAT IS YOUR NAME'); READLN; (* FORCE A GET *) I := 1; WHILE NOT EOLN DO BEGIN READ(NAME[I]); I := I + 1; END; . . . Sorry about all caps but the Cyber doesn't have upper/lower case (normally) and I wanted to be realistic. Anyway, the question, what would the same code look like in say VAX Pascal or MS Pascal? I mean, it would seem that to follow the way Pascal is supposed to work with the "look ahead" buffer it would require something special to avoid the above example. (unless, of course, I am completely missing something). For those of you who would wonder why I would read in a string like this, its because Cyber's Pascal also didn't have String capabilities. It was pretty close to the original that Wirth created. As far as the I/O being one of Pascal's strengths, try explaining the above example to a beginner. I've tried, the response is usually a quizzical look and a shaking head. Robert Keiser