Category : Pascal Source Code
Archive   : SPOOL100.ZIP
Filename : SPOOLDEM.PAS

 
Output of file : SPOOLDEM.PAS contained in archive : SPOOL100.ZIP
program SpoolerDemo;

uses Crt,Dos,Spooler;

const NUL = #00;
ESC = #27;

var SStatus : word;
k,
e : char;
Queue : QueueType;
s : string;

{ ------------------------------------------------------------- SpoolerReport }
procedure SpoolerReport(DosErrorOnly : boolean);

begin
SStatus := SpoolerStatus;
if not DosErrorOnly then LowVideo; write('Stato dello Spooler: ');
case SStatus of
SPOOLER_INSTALLED : if not DosErrorOnly then
begin
HighVideo; writeln('INSTALLATO');
writeln;
end;
SPOOLER_NOT_INSTALLED : if not DosErrorOnly then
begin
HighVideo; writeln('NON INSTALLATO');
writeln;
LowVideo; write('Dai il comando: ');
HighVideo; write('PRINT /D:PRN /Q:32');
LowVideo; writeln(' (da DOS).');
writeln;
end;
SPOOLER_CANNOT_BE_INSTALLED : if not DosErrorOnly then
begin
HighVideo; write('NON INSTALLATO');
LowVideo; write(' e ');
HighVideo; writeln('NON INSTALLABILE');
writeln;
end;
else begin
LowVideo; write('Probabile ');
HighVideo; writeln('ERRORE MS-DOS ',SStatus);
writeln;
end;
end;
end;

{ -------------------------------------------------------------------- Banner }
procedure Banner;

begin
DirectVideo := false;
ClrScr;

LowVideo; write('Test della ');
HighVideo; write('SPOOLER UNIT');
LowVideo; write(' ver. ');
HighVideo; write('1.0');
LowVideo; write(' del ');
HighVideo; write('21/04/90');

writeln; writeln;
end;

{ ------------------------------------------------------------------- WaitKey }
function WaitKey(prompt : string; var extkey : char) : char;

begin
LowVideo; write(prompt);
k := readkey;
if (k=NUL) then extkey := readkey;
writeln;
WaitKey := k;
end;

{ ---------------------------------------------------------- DisplayQueueList }
procedure DisplayQueueList;

var i,
c : byte;

begin
i := 1;
c := 0;
writeln;
while ((length(Queue[i])<>0) and (i<=MAX_SPOOLER_ENTRY)) do
begin
HighVideo; write(Queue[i]);
LowVideo; gotoxy(65,wherey); if (i=1) then writeln(' Š in stampa.')
else writeln(' Š in coda.');
inc(i);
inc(c);
end;
if (c=0) then
begin
HighVideo; writeln('La coda Š vuota.');
end;
writeln;
end;

{ -------------------------------------------------------------- SubmitReport }
procedure SubmitReport;

begin
case SpoolerResult of
0 :
begin
ListQueue(Queue);
DisplayQueueList;
end;
QUEUE_FULL :
begin
k := WaitKey('CODA PIENA, premi un tasto per vedere i files in coda.',e);
DisplayQueueList;
end;
else
begin
str(SpoolerResult,s);
k := WaitKey('ERRORE SCONOSCIUTO ('+s+'), premi un tasto.',e);
end;
end;
end;

{ ============================================================== SPOOLER TEST }
begin
Banner;
SpoolerReport(false);
if (SStatus<>SPOOLER_INSTALLED) then halt(1);

k := WaitKey('SPEGNI o metti in LOCAL la STAMPANTE e premi un tasto.',e);

ClrScr;

SubmitFileS('SPOOL*.*',Queue);
SubmitReport;

k := WaitKey('Premi un tasto che CANCELLO SPOOLER.PAS (dalla coda).',e);

CancelFiles('SPOOLER.PAS');
ListQueue(Queue);
DisplayQueueList;

k := WaitKey('Premi un tasto che CANCELLO TUTTI i FILES (dalla coda).',e);

CancelAllFiles;
ListQueue(Queue);
DisplayQueueList;

k := WaitKey('Se vuoi STAMPARE SPOOLER.DOC ACCENDI e METTI ON LINE la STAMPANTE o premi ESC.',e);

if (k<>ESC) then
begin
SubmitFiles('SPOOLER.PAS',Queue);
SubmitReport;
k := WaitKey('Premi un tasto.',e);
end;

ClrScr;
LowVideo; write('Thank you for using ');
HighVideo; write('SPOOLER UNIT');
LowVideo; writeln('.');
writeln;
end.

  3 Responses to “Category : Pascal Source Code
Archive   : SPOOL100.ZIP
Filename : SPOOLDEM.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/