Category : BASIC Source Code
Archive   : PBVL010.ZIP
Filename : SPOOLER.BAS

 
Output of file : SPOOLER.BAS contained in archive : PBVL010.ZIP
'ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
'³ FILE: SPOOLER.BAS ³
'³ PURPOSE: PB/VISION(tm) LITE Example Program ³
'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
'³ PURPOSE: Demonstrates how the "TimerInstallCode()" routine can be used ³
'³ as the engine for a printer spooler. ³
'ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´
'³ For instant help on any PB/VISION(tm) keyword, place the cursor on that ³
'³ keyword and press . The PB/VISION(tm) index can be accessed ³
'³ by pressing twice. The file "PBVLITE.PBH" _must_ be in the ³
'³ same directory as the PowerBASIC IDE (PB.EXE) for this feature to work ³
'³ properly. ³
'ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ

' ==================================================
' BE SURE TO RUN "DEMO.EXE" FOR INFORMATION ON OTHER
' PowerBASIC 3.0 TOOLS FROM DSE SOFTWARE PUBLISHING.
' ==================================================

%ISPBU = 0

$INCLUDE ".\WINDOW.BI"
$INCLUDE ".\EVENT.BI"
$INCLUDE ".\MOUSE.BI"

$STACK 8192

DEFINT A-Z
$DYNAMIC

%EndOfFile = 1001

SHARED SH%, A, B, C, D, SpoolFile

SPOOLER.INIT ' initialize the demo interface
SPOOLER.RUN ' run the interface
SPOOLER.DONE ' terminate program

END

SUB SPOOLER.INIT

filename$ = COMMAND$ ' read file name from command line

IF LEN(filename$) = 0 THEN
CLS
PRINT "Syntax: SPOOL filename.txt
END
ELSE
SpoolFile = FREEFILE
OPEN filename$ FOR INPUT AS SpoolFile
END IF

app.GraphicsMouse = 1
app.GraphicsMode = 1

APPTITLE &H70, "SPOOLER.BAS - HOW TO DO PRINT SPOOLING FROM PB/VISION(tm)

APPINIT

GottaMouse% = MOUSEINIT(buttons%) ' initizlize mouse
MOUSECURSORON ' turn it on

A = WINPOPUP (3, 5, 10, 40, &H9F, 1, &H9F, "SPOOLER.BAS", &HE0, %DRAGBAR OR %SHADOW)
B = WINPOPUP (5, 10, 10, 40, &HA7, 1, &HA8, "SPOOLER.BAS", &HCF, %DRAGBAR OR %SHADOW)
C = WINPOPUP (7, 15, 10, 40, &HF1, 1, &HF1, "SPOOLER.BAS", &H9F, %DRAGBAR OR %SHADOW)
D = WINPOPUP (9, 20, 10, 40, &HCF, 1, &HCF, "SPOOLER.BAS", &HB0, %DRAGBAR OR %SHADOW)

WINWRITELN D, "Spooling " + filename$

TIMERINSTALLCODE CODESEG(SpoolRoutine), CODEPTR(SpoolRoutine)

END SUB

SUB SPOOLER.RUN

DO
eventNo = GetEvent(0)

SELECT CASE eventNo

CASE 102
CLOSE #SpoolFile
EXIT SUB

CASE %EndOfFile
WINWRITELN D, "End of file"
TIMERINSTALLCODE 0, 0
CLOSE #SpoolFile

END SELECT

LOOP

END SUB

SUB SPOOLER.DONE
MOUSECURSOROFF
APPCLOSE
END
END SUB

FUNCTION SpoolRoutine% (BYVAL UpdateOk%) PUBLIC

IF EOF(SpoolFile) THEN
SpoolRoutine = %EndOfFile
EXIT FUNCTION
END IF

LINE INPUT #SpoolFile, text$

LPRINT text$

END FUNCTION


  3 Responses to “Category : BASIC Source Code
Archive   : PBVL010.ZIP
Filename : SPOOLER.BAS

  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/