Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!ncar!gatech!ukma!psuvm.bitnet!cunyvm!byuvax!taylorj From: taylorj@byuvax.bitnet Newsgroups: comp.lang.pascal Subject: RE: Universal writeln in Turbo Pascal? Message-ID: <157taylorj@byuvax.bitnet> Date: 17 Mar 88 04:08:44 GMT Lines: 36 Here's what you need for a writeln that will write to anything. Define fd as a text file: var fd :text; Then to write to the screen: assigncrt(fd); This assigns the output file to Turbo Pascal 4.0's fast (very fast!) CRT driver. (If you're using Turbo 3.0, use assign(fd, 'con') instead.) To write to a file, do a standard assign: assign(fd, 'filename'); To write to the printer, assign to a device name: assign(fd, 'prn'); You can use any DOS device name such as 'aux', 'com1', 'lpt1', etc. Last, (and importantly) open your output file for writing to: rewrite(fd); Then you can use writeln(fd, 'Whatever'); I use this in most of my programs, so I know it works. Have fun! Jim Taylor Microcomputer Support for Curriculum, Brigham Young University taylorj@byuvax.bitnet