home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / program / pascal / pasdox / lstout.txt < prev    next >
Text File  |  1986-10-15  |  3KB  |  96 lines

  1. { -----------------------------------------------------------------------------
  2.  
  3.                                  NOTICE:
  4.  
  5.       THESE MATERIALS are UNSUPPORTED by OSS!  If you do not understand how to
  6.       use them do not contact OSS for help!  We will not teach you how to
  7.       program in Pascal.  If you find an error in these materials, feel free
  8.       to SEND US A LETTER explaining the error, and how to fix it.
  9.  
  10.       THE BOTTOM LINE:
  11.  
  12.          Use it, enjoy it, but you are on your own when using these materials!
  13.  
  14.  
  15.                                DISCLAIMER:
  16.  
  17.       OSS makes no representations or warranties with respect to the contents
  18.       hereof and specifically disclaim all warranties of merchantability or
  19.       fitness for any particular purpose.   This document is subject to change
  20.       without notice.
  21.  
  22.       OSS provides these materials for use with Personal Pascal.  Use them in
  23.       any way you wish.
  24.  
  25.    -------------------------------------------------------------------------- }
  26.  
  27.  
  28.                 Sending Screen Output to Printer
  29.  
  30.                        September 29, 1986
  31.  
  32.  
  33. Some  Personal Pascal users have had difficulty sending output  to
  34. the printer.  We admit the Personal Pascal manual is somewhat thin
  35. on  this subject,  so we will present some additional  information
  36. here.
  37.  
  38. If  you want to send output from your Write or Writeln  statements
  39. to  the printer,  all you have to do is insert the  folowing  line
  40. somewhere before the Write or Writeln statements you want sent  to
  41. the printer:
  42.  
  43.     Rewrite( output, 'LST:' );
  44.  
  45. from this point on,  all output that normally would show on the ST
  46. display  will go to the printer (assuming that you have a  printer
  47. attached and on-line!).
  48.  
  49. If you want to switch back to the display after sending output  to
  50. the  printer,  you  will need to insert  the  following  statement
  51. before  the  Write  or Writeln statements you  want  sent  to  the
  52. screen:
  53.  
  54.     Rewrite( output, 'CON:' );
  55.  
  56. from this point on,  all output from Write and Writeln will go  to
  57. the screen.
  58.  
  59. It  is  possible to send output to the  printer  while  displaying
  60. information  on the screen.   You must declare a global  variable,
  61. then Rewrite it as shown below:
  62.  
  63. { example program -- output to printer }
  64. program print_out;
  65.  
  66. VAR
  67.  
  68.      Print : TEXT; { set up a file variable called Print, the
  69.                      name is not significant! }
  70.  
  71. BEGIN
  72.  
  73.      Writeln( 'Example program sends output to printer ' );
  74.  
  75.      Rewrite( output, 'LST:' ); { output now goes to printer }
  76.  
  77.      Writeln( 'This should show up on printer, not screen!' );
  78.      Write( 'So should ' );
  79.      Writeln( 'this...' );
  80.  
  81.      Rewrite( output, 'CON:' ); { now output goes back on screen }
  82.  
  83.      Rewrite( Print, 'LST:' ); { set up file variable to take output }
  84.  
  85.      Writeln( 'You should see this on the ST Screen' );
  86.  
  87.      Writeln( Print, 'This should go out to your printer!' );
  88.      Writeln( Print, 'Notice that we only send output to ' );
  89.      Writeln( Print, 'printer using the Print file variable! ' );
  90.  
  91.      Writeln( 'All done printing!' );
  92.  
  93. END.
  94. { end of program! }
  95.  
  96.