Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!ctrsol!ginosko!husc6!psuvax1!news From: schwartz@shire.cs.psu.edu (Scott Schwartz) Newsgroups: comp.lang.pascal Subject: Re: file windows (was Re: Standard Pascal) Message-ID: Date: 30 Jul 89 15:31:09 GMT References: <2929@virginia.acc.virginia.edu> <1.filbo@gorn.santa-cruz.ca.us> Sender: news@psuvax1.cs.psu.edu Organization: Pennsylvania State University, computer science Lines: 25 In-reply-to: filbo@gorn.santa-cruz.ca.us's message of 30 Jul 89 14:17:43 GMT In article <1.filbo@gorn.santa-cruz.ca.us> Bela Lubkin writes: +----- | A >simpler< and >more< elegant | piece of Standard Pascal code that does the same thing is: | | while not eof do begin | read(number); | if (number >= '0') and (number <= '9') then process(number); | { else don't do anything, thus disposing of the invalid char } | end +----- In the previous posting, Number was of type REAL (or INTEGER), not CHAR. Why write code to "process" it when the language will do it for you? That's what file windows buy you. Your example is incomplete, then, whereas the other posting contained complete code to do the operation, in approxomately the same number of lines. A telling point in favor of using language features to their fullest. -- Scott Schwartz