{ ----------------------------------------------------------------------------- NOTICE: THESE MATERIALS are UNSUPPORTED by OSS! If you do not understand how to use them do not contact OSS for help! We will not teach you how to program in Pascal. If you find an error in these materials, feel free to SEND US A LETTER explaining the error, and how to fix it. THE BOTTOM LINE: Use it, enjoy it, but you are on your own when using these materials! DISCLAIMER: OSS makes no representations or warranties with respect to the contents hereof and specifically disclaim all warranties of merchantability or fitness for any particular purpose. This document is subject to change without notice. OSS provides these materials for use with Personal Pascal. Use them in any way you wish. -------------------------------------------------------------------------- } Sending Screen Output to Printer September 29, 1986 Some Personal Pascal users have had difficulty sending output to the printer. We admit the Personal Pascal manual is somewhat thin on this subject, so we will present some additional information here. If you want to send output from your Write or Writeln statements to the printer, all you have to do is insert the folowing line somewhere before the Write or Writeln statements you want sent to the printer: Rewrite( output, 'LST:' ); from this point on, all output that normally would show on the ST display will go to the printer (assuming that you have a printer attached and on-line!). If you want to switch back to the display after sending output to the printer, you will need to insert the following statement before the Write or Writeln statements you want sent to the screen: Rewrite( output, 'CON:' ); from this point on, all output from Write and Writeln will go to the screen. It is possible to send output to the printer while displaying information on the screen. You must declare a global variable, then Rewrite it as shown below: { example program -- output to printer } program print_out; VAR Print : TEXT; { set up a file variable called Print, the name is not significant! } BEGIN Writeln( 'Example program sends output to printer ' ); Rewrite( output, 'LST:' ); { output now goes to printer } Writeln( 'This should show up on printer, not screen!' ); Write( 'So should ' ); Writeln( 'this...' ); Rewrite( output, 'CON:' ); { now output goes back on screen } Rewrite( Print, 'LST:' ); { set up file variable to take output } Writeln( 'You should see this on the ST Screen' ); Writeln( Print, 'This should go out to your printer!' ); Writeln( Print, 'Notice that we only send output to ' ); Writeln( Print, 'printer using the Print file variable! ' ); Writeln( 'All done printing!' ); END. { end of program! }