BBS: Inland Empire Archive Date: 02-14-93 (06:58) Number: 373 From: WALT MAYO Refer#: NONE To: ALL Recvd: NO Subj: .BSV Screen Grabber TSR i Conf: (2) Quik_Bas
Well...maybe I can finally contribute something around here. I *badly* needed a .BSV or ANSI screen grabber and came up with this simple little brainstorm. Why not put a quick BSAVE routine in a PowerBasic TSR? And...sooo...I simply strung together a couple of samples of code from the PB manual and disk and made BSVGRAB.BAS. The amazing thing to me is that the da*n thing works! It *really* needs some additional code, error-trapping for existing files and such. If anyone would be willing to dress it up and re- post, I would be most grateful. In the code below, it assumes you're saving the files in a directory called C:\ZDIR, so make any changes you need. Also...make sure you don't have an existing file or it will crash. It also assumes you're in standard text mode, 16 color, 80x25. I'm sure you could change things to make it more versatile. BSVGRAB seems to work OK even in the DesqView environment (most of the time). Use at your own risk. '*********************************************************************** '* PopUp .BSV Screen Capture Routine '* Walt Mayo 1993, 1:3627/101 DATA:803-650-8315 VOICE:803-650-0140 '* PowerBasic 3.0 '* This file seems to work great in most situations. '* It does need some error-trapping added for existing files, so beware. '* ********************************************************************* $COMPILE EXE ' this tells PB to make a standalone EXE $LIB IPRINT OFF ' allow graphic characters to print $OPTION CNTLBREAK OFF ' not wise in a tsr x& = SETMEM(-700000) ' release unused memory POPUP KEY CHR$(8,30,247) ' ALT A is the hot key POPUP MULTIPLEX &HC000, 254 ' reg AX and DX get this pattern as an ID REG 1, &HC000 : REG 4, 254 ' set pattern to check for already installed CALL INTERRUPT &H2F ' do the multiplex interrrupt IF REG(1)<>&HC000 AND REG(4)<>254 THEN END 'we were already installed SwapFile$ = LEFT$(CURDIR$,2)+"\ASCTSR.SWP" PRINT "PopUp .BSV grabber available as ALT-A" REG 1, &HC001 : REG 4, 252 ' Alter AX,DX to show we were here POPUP SLEEP USING EMS, SwapFile$ ' before going to sleep WHILE 1=1 x% = POS : y% = CSRLIN DEF SEG = &hB800 SaveScreen$ = PEEK$(0,4000) ' save the entire screen IF REG(1)=&HC000 AND REG(4)=254 THEN LOCATE 12,20 PRINT "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"; LOCATE 13,20 PRINT "³ BSVGRAB is already installed ³"; LOCATE 14,20 PRINT "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"; ELSE GOSUB GrabBSV END IF a$ = INPUT$(1) 'wait for key to cancel POKE$ 0, SaveScreen$ : LOCATE y%, x% 'restore screen IF UCASE$(A$)="Q" THEN IF POPUP(1) THEN END 'this uninstalls us REG 1, &HC001 : REG 4, 252 ' Alter AX,DX to show we were here POPUP SLEEP ' before going to sleep WEND GrabBSV: DEF SEG = &HB800 BSAVE "c:\zdir\axax.bsv", 0, 4000 LOCATE 1, 1 COLOR 14, 2 PRINT " "; LOCATE 1, 1 INPUT " Enter desired name for file: ", NewName$ NAME "c:\zdir\axax.bsv" as "c:\zdir\" + NewName$ LOCATE 1, 1 COLOR 15, 3 PRINT " Press Q to remove BSVGRAB, any other key to continue " 'DEF SEG RETURN '------------------- Snip Here --------------------------------------- -----------------------> \\/alt --- GoldED 2.40 * Origin: Periscope! Home of the OPTOMETRY Echo! (1:3627/101)
Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET