home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / GRAPHICS.DI$ / PRINTOPT.M < prev    next >
Encoding:
Text File  |  1993-03-25  |  2.3 KB  |  85 lines

  1. function [pcmd,dev] = printopt
  2. %PRINTOPT Configure local printer defaults.
  3. %    PRINTOPT is an M-file that you or your system manager can
  4. %    edit to indicate your default printer type and destination.
  5. %
  6. %    [PCMD,DEV] = PRINTOPT returns two strings, PCMD and DEV.
  7. %    PCMD is a string containing the print command that PRINT
  8. %    uses to spool a file to the printer. Its default is:
  9. %
  10. %       Unix:      lpr -r
  11. %       Windows:   PRINT
  12. %       Macintosh: unused
  13. %       VMS:       PRINT/DELETE
  14. %       SGI:       lp
  15. %
  16. %    DEV is a string containing the default device option for 
  17. %    the PRINT command. Its default is:
  18. %
  19. %       Unix & VMS: -dps
  20. %       Windows:    -dwin
  21. %       Macintosh:  -dmac
  22. %
  23. %    See also PRINT.
  24.  
  25. %    Copyright (c) 1984-93 by the MathWorks, Inc.
  26.  
  27. % Indicate default device option here. See PRINT.M for a 
  28. % complete list of available devices. Uncomment and/or change
  29. % one of the following, depending upon your computer type.
  30. % dev = '-dps';       % Unix & VAX/VMS
  31. dev = '-dwin';      % Windows
  32. % dev = '-dmac';      % Macintosh
  33.  
  34. % Indicate default print command string here. Uncomment and/or
  35. % change one of the following, depending upon your computer type.
  36. % pcmd = 'lpr -r';       % Unix
  37. % pcmd = 'lpr -r -Pfred' % Unix, to a printer named fred
  38. pcmd = 'COPY /B %s LPT1:';        % Windows, parallel printer
  39. % pcmd = 'SPR';          % Windows, serial printer 
  40. % pcmd = 'unused';       % Macintosh
  41. % pcmd = 'PRINT/DELETE'; % VAX/VMS
  42. % pcmd = 'lp';           % SGI
  43.  
  44.  
  45. % ----------- Do not modify anything below this line ---------------
  46. % Try to do something reasonable for people that have not yet
  47. % configured their default print command string.
  48.  
  49. if ~exist('pcmd')
  50.     cname = computer;
  51.  
  52.     % For Unix
  53.     pcmd = 'lpr -r';
  54.  
  55.     % For Windows
  56.     if strcmp(cname(1:2),'PC'),  pcmd = 'PRINT'; return; end
  57.  
  58.     % For Macintosh
  59.     if strcmp(cname(1:3),'MAC'), pcmd = 'prtsc'; end
  60.  
  61.     % For SGI
  62.     if strcmp(cname(1:3),'SGI'), pcmd = 'lp'; end
  63.  
  64.     % For VAX/VMS
  65.     if length (cname) >= 6 
  66.        if strcmp(cname(1:6),'VAXVMS')
  67.         pcmd = 'PRINT/DELETE';
  68.        end
  69.     end
  70.  
  71. end
  72.  
  73. if ~exist('dev')
  74.     cname = computer;
  75.  
  76.     % For Unix and VAX/VMS
  77.     dev = '-dps';
  78.  
  79.     % For Windows
  80.     if strcmp(cname(1:2),'PC'),  dev = '-dwin'; return; end
  81.  
  82.     % For Macintosh
  83.     if strcmp(cname(1:3),'MAC'), pcmd = '-dmac'; end
  84. end
  85.