Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!usc!ucla-cs!uci-ics!milne From: milne@ics.uci.edu (Alastair Milne) Newsgroups: comp.lang.pascal Subject: Re^2: Standard Pascal Message-ID: <18965@paris.ics.uci.edu> Date: 1 Jul 89 01:04:48 GMT References: <8616@pyr.gatech.EDU> Sender: news@paris.ics.uci.edu Lines: 35 mlw@pyr.gatech.EDU (Michael Williams) writes: >Borland obviously left get and put out of turbo pascal for a reason. >Can anyone tell me why get and put are better than read and write? >Used in conjunction with the seek command, I find read/write almost >identical to array access for a file of records, which is quite helpful. I suspect the reason was nothing more profound than a desire to simplify the parse tables -- and the number of predeclared routines. (Though there is perhaps a more substantial reason: they haven't implemented file variables as pointers to the file window, which is what -- or close to what -- most Pascal's do. See below about the consequences of not doing so.) I don't know that GET and PUT are necessarily "better" than read or write, but they are certainly more standard. Using them, I can transport typed file I/O among a number of Pascal dialects; Turbo is the only one I know of that overloads READ and WRITE, so it's the only one where that will work. I can't see any real advantage in SEEK and READ, rather than SEEK and GET: SEEK( RecordFile, RecordIndex); READ( RecordFile, NewRecord); or SEEK( RecordFile, RecordIndex); GET( RecordFile); NewRecord := RecordFile^; { In Turbo, this assignment is impossible, because the file variable isn't a window pointer, so it can't be dereferenced. } As far as I'm aware, the principal impact of this substitution is that porting things between Turbo and other dialects gets a little harder. Alastair Milne