Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!hc!lll-winken!uunet!portal!cup.portal.com!Dex From: Dex@cup.portal.com (Paul Dex Durden) Newsgroups: comp.lang.pascal Subject: Using logical device LST: in TP5 Message-ID: <17691@cup.portal.com> Date: 28 Apr 89 03:52:45 GMT Organization: The Portal System (TM) Lines: 56 Hi, I've been programming at UAH using TP3.02a and noticed that in TP5 I couldn't open a file assigned to the logical device 'LST:' like I could in TP3. I know you can use the variable LST in the write statements to send the output to the printer but below is what I had originaly wrote and would like to keep, rather than having to double up on code and rewrite it for output to disk and printer. This is similar to the dual ouput message string that went through last month, but I did not pay attention to that string because I wasn't having a problem with it in TP3. Any help will be greatly appreciated. Thanks in advance, Paul 'Dex' Durden |\ '|\ ' |\ +--------------------------------+ |/ | | | | | E-mail to: Dex@cup.portal.com | |aul |/ex |/urden +--------------------------------+ In TP3 the below code works but in TP5 I get a 'File not found error' when REWRITing Out when out is assigned to LST: USES TURBO3,CRT,PRINTER; VAR I : INTEGER; OUT : TEXT; BEGIN FOR I:=1 TO 2 DO BEGIN IF I = 1 THEN BEGIN ASSIGN(OUT,'LST:'); {Direct output to printer} REWRITE(OUT); END ELSE BEGIN ASSIGN(OUT,'A:FILENAME.TXT'); {Direct output to FILENAME} REWRITE(OUT); END; WRITELN(OUT,'DATA HERE'); WRITELN(OUT,'More data'); IF I = 1 THEN WRITELN(^L); {Form feed} CLOSE(OUT); END; {FOR} END.