Search Locate Previous Next Contents

nlSpool – save report on file

As you build up your report, completed pages are saved to file. When the report is finished, you can run the nlSpool function, which adds header details (for example it enumerates the fonts used in the document) and closes the file, returning the name to your application. You can check the number of pages, or preview/print the file as normal:

     spl„nlSpool ''   © Retain default name
     nlNumPages spl
47

This can be printed with the Print function in the PostScript namespace, or you might wish to preview it first with the View function:

psView spl     © View starting from the first page
5 psView spl   © Start at the 5th page
  psPrint spl  © Entire report
3 4 5 101 psPrint spl     © Selected pages

In general it makes sense to use Spool rather than Close for reports of more than 10 pages, as the time taken to read from file is less than the time to check the full report for a particular page. Also there is no danger of WS FULL!

If you need to retain the spool file for further processing (for example to make into booklets in a duplex layout) call nlSpool with a file name as right argument:

spl„nlSpool 'c:\temp\run1'  © returns full name

By default, NewLeaf holds the spool file in the TEMP directory. If this causes problems, set the global ‘spoolpath to the file path of your choice:

leaf‘spoolpath„'s:\temp'  © Spool on network drive

If you require system-generated unique names for the spool files, set:

nl‘spoolname„''

... which will make the filename from the system time in the form ‘~1234567.spl’.



Continue to: nlStyle – set paragraph style
© Copyright Causeway Graphical Systems Ltd 2001