' ' The following routine may be used to allow powerBASIC programs to ' make use of the MSDOS background print queue. ' Donated by Steve Mclaren (UK) 70374,3467. ' Any queries mail me direct. ' ' *** NOTE *** ' This program will not work in the PB enviroment, you will ' have to compile it and run it from a command line ' ' ' Define the Register Constants & Interupt Values ' %Flags = 0: %AX = 1: %BX = 2: %CX = 3: %DX = 4: %SI = 5: %DI = 6 %BP = 7: %DS = 8: %ES = 9 %MultiplexInt = &H2F %GetStatus = &H0100 %PrintFunc = &H0101 ' ' Example code ' CLS Filename$ = COMMAND$ IF PrintQueInstalled THEN CALL SubmitFileToQue( Filename$ ) ELSE PRINT "Print has not been installed" END IF END FUNCTION PrintQueInstalled ' ' Check For Resident Part Of Print Installed (Install PRINT.COM/EXE) ' REG %AX, %GetStatus CALL INTERRUPT %MultiplexInt RegisterAL% = REG( %AX ) AND &HFF IF ( RegisterAL% ) = &HFF THEN PrintQueInstalled = -1 ELSE PrintQueInstalled = 0 END IF END FUNCTION SUB SubmitFileToQue( Filename$ ) DIM SubmitPacket%( 2 ) ' ' Set Filename TO ASCIIZ Format ' F$ = Filename$ + CHR$( 0 ) ' ' Load 5 Byte Packet ' SubmitPacket%( 0 ) = 0 SubmitPacket%( 1 ) = STRPTR( F$ ) SubmitPacket%( 2 ) = STRSEG( F$ ) ' ' Submit File To Print Spooler Using Packet Information ' REG %AX, %PrintFunc REG %DS, VARSEG( SubmitPacket%( 0 )) REG %DX, VARPTR( SubmitPacket%( 0 )) + 1 CALL INTERRUPT %MultiplexInt ' ' Read The Carry Flag For Result ' CarryFlag% = ( REG( %Flags ) AND 1% ) IF CarryFlag% < > 0 THEN ' ' Set Error ' SELECT CASE REG( %AX ) CASE &H01: PError$ = "Function Invalid" CASE &H02: PError$ = "File Not Found" CASE &H03: PError$ = "Path Not Found" CASE &H04: PError$ = "To Many Files" CASE &H05: PError$ = "Permission Denied" CASE &H08: PError$ = "Queue Full" CASE &H09: PError$ = "Spooler Busy" CASE &H0C: PError$ = "Name Too Long" CASE &H0F: PError$ = "Drive Invalid" CASE ELSE PError$ = "Unknown Error" END SELECT ELSE PError$ = "File Submitted" END IF PRINT PError$ END SUB