Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!usc!cs.utexas.edu!uunet!mcvax!kth!sunic!dkuug!freja!rimfaxe!dat0 From: dat0@rimfaxe.diku.dk (Dat-0 undervisningsassistent) Newsgroups: comp.lang.pascal Subject: Re: file windows (was Re: Standard Pascal) Message-ID: <4623@freja.diku.dk> Date: 12 Jul 89 12:39:02 GMT References: <8616@pyr.gatech.EDU> <18965@paris.ics.uci.edu> Sender: news@freja.diku.dk Lines: 28 schwartz@shire.cs.psu.edu (Scott Schwartz) writes: >Alastair Milne writes: >| > while (input^ in [space, tab, newline, cr, formfeed]) do >| > get (input) >| >| How does this constitute not commiting to read the file variable? You are >| doing exactly that when you dereference the file variable to get its >| window. >I didn't say you don't commit to reading the the window variable. The >thing you don't commit to is advancing the file pointer: commiting to >read from the FILE. As somebody already have pointed out, "read(input, ch)" is exactly equivalent to "ch:=input^;get(input)" (by definition of the ISO standard). The interesting thing about this is (IMHO) that using the filewindow you can check what you are about to read, not just what you have already read. I have seen a couple of examples, where this saves you a lot of trouble. BTW it is the file-window that allows you to check eoln and eof. How do you manage to check that, if you don't have some kind of look-ahead? Kristian Damm Jensen (dat0@diku.dk) Institute of datalogi, University of Copenhagen (DIKU)