home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / Icon 8.1 / mep1 / Samples / Programs / print.icn < prev    next >
Encoding:
Text File  |  1989-05-09  |  1.1 KB  |  34 lines  |  [TEXT/PICN]

  1. ############################################################################
  2. #
  3. #  print.icn
  4. #  
  5. #     This program prints files.  The user is prompted with a Get File
  6. #  dialog. For the first file, the user is presented with a Page Setup ...
  7. #  dialog and a Print Job dialog.  These dialogs are omitted for
  8. #  subsequent files.  Files are processed until the user selects Cancel
  9. #  in a Get File dialog.
  10. #
  11. #     There is no restriction on file type, so printing an application
  12. #  or other non-text file may produce unpredictable results.  To restrict
  13. #  file types, change the getfile() function call to:
  14. #
  15. #            getfile("File? (last was " || name ||" )", "TEXT")
  16. #
  17. #     The file is first read in to an invisible window, so only files
  18. #  that fit in ProIcon's memory space may be printed. 
  19. #  
  20. #############################################################################
  21.  
  22. procedure main()
  23.     local name, setup, job, window
  24.  
  25.     name := "..."
  26.     setup := job := 1
  27.  
  28.     while name := getfile("File? (last was " || name ||" )") do {
  29.         window := wopen(name,"f") | stop("*** cannot open ",name)
  30.         wprint(window,setup,job)
  31.         setup := job := 0
  32.         wclose(window)
  33.         }
  34. end