home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / cdactual / demobin / share / program / Pascal / 10TLST.ZIP / SPRINT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1990-10-17  |  921 b   |  38 lines

  1. {$M 32768,0,32768}
  2. Program Sprint;
  3. Uses CRT,DOS,Tentools;
  4.  
  5. VAR
  6.    Filename : String;
  7.    TestWord : Word;
  8.    ComSpec : String;
  9.    DOSWord : Word;
  10. Begin
  11.    TestWord:=SetSpool(1,'',[Start,Completion],1);
  12.    If (ParamCount=0)
  13.    then
  14.     begin
  15.        TestWord:=CloseSpool;
  16.        If (TestWord<>0) then Writeln('Creating initial Spool!');
  17.        TestWord:=OpenSpool('');
  18.     end
  19.    else if ParamCount>0
  20.    then
  21.     begin
  22.        Comspec:=GetEnv('COMSPEC');
  23.        Filename:=Paramstr(1);
  24.        SwapVectors;
  25.        Exec(COMSPEC,'/C COPY '+Filename+' LPT1:');
  26.        SwapVectors;
  27.        DOSWord:=DOSError;
  28.        If (DOSWord<>0) then Writeln('Insufficient Memory to Sprint!')
  29.        else
  30.         begin
  31.            TestWord:=CloseSpool;
  32.            Writeln(Filename,' sent to printer!');
  33.            TestWord:=OpenSpool('');
  34.            Writeln('New Spool opened...');
  35.         end;
  36.     end;
  37. End.
  38.