Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!ames!purdue!haven!vrdxhq!bms-at!stuart From: stuart@bms-at.UUCP (Stuart Gathman) Newsgroups: comp.lang.pascal Subject: Re: Standard Pascal Summary: Ridiculous! Message-ID: <168@bms-at.UUCP> Date: 15 Jul 89 01:13:30 GMT References: <8736@pyr.gatech.EDU> Distribution: usa Organization: Business Management Systems, Inc., Fairfax, VA Lines: 50 In article <8736@pyr.gatech.EDU>, gus@pyr.gatech.EDU (gus Baird) writes: > No! There's a TREMENDOUS difference between > repeat > read(FileVar,ch) > until ch {is whatever}; > and > while FileVar^ {is not whatever} do > get(input); > The point is that that the version with read consumes the character > that stops the loop. This means that the routine after the skiptill So in one case the terminating char is in "Filevar^", and in the other case it is in "ch". Big deal. while FileVar^ {is not whatever) do get(input); is just var FileVar: ^byte; read(input,FileVar^); . . . while FileVar^ { ... } do read(input,FileVar^); If pascal had macros, you could either in terms of the other. The pointer stuff is a bother. The file variable stuff is just a convention as to where your one character read ahead is kept. Using "ch" as a convention is just as good as using "FileVar^", and more efficient to boot. (I prefer "unget(ch)" myself :-) BTW, Shouldn't "get(input)" be "get(FileVar)"? In that case get and put are even more braindamaged with such an inconsistent use of pointer notation. They could still be macros, however. FileVar would be #define FileVar F.buf { excuse me } and get could find the 'F' record address from the pointer address. -- Stuart D. Gathman <..!{vrdxhq|daitc}!bms-at!stuart>