Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!cbosgd!cwruecmp!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon S. Allbery) Newsgroups: comp.sys.ibm.pc Subject: Turbo Pascal vs. the Input standard file Message-ID: <2575@ncoast.UUCP> Date: Sat, 30-May-87 20:43:28 EDT Article-I.D.: ncoast.2575 Posted: Sat May 30 20:43:28 1987 Date-Received: Tue, 2-Jun-87 05:15:47 EDT Reply-To: allbery@ncoast.UUCP (Brandon S. Allbery) Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 35 I'm trying to write a program which will read standard input or files named on the command line. (It's a program to expand tabs and formfeeds for my DuMbPrinter-105.) The main block seemed simple enough: begin if ParamCount = 0 then Process(Input) else for arg := 1 to ParamCount do begin Assign(Infile, ParamStr(arg)); Reset(Infile); Process(Infile); Close(Infile) end end. BUT -- My Turbo Pascal (3.01A) doesn't seem to recognize Input as a file. If I leave it undeclared, I get a compile error `unknown identifier or syntax error'; if I declare it, I get I/O error 02 (file not reset). Is the standard input file available as a file variable? I'd rather not have two versions of the Process procedure, one for standard input and one for a file. Thanks in advance, ++Brando -- Copyright (C) 1987 Brandon S. Allbery. Redistribution permitted only if the redistributor permits further redistribution. ---- Moderator for comp.sources.misc ---- Brandon S. Allbery {decvax,cbatt,cbosgd}!cwruecmp!ncoast!allbery Tridelta Industries {ames,mit-eddie,talcott}!necntc!ncoast!allbery 7350 Corporate Blvd. necntc!ncoast!allbery@harvard.HARVARD.EDU Mentor, OH 44060 +01 216 255 1080 (also eddie.MIT.EDU)