BBS: Inland Empire Archive Date: 04-15-93 (17:22) Number: 328 From: VICTOR YIU Refer#: NONE To: TOM CARROLL Recvd: NO Subj: Re: BSave & BLoad Conf: (2) Quik_Bas
>>> Regurgitating Tom Carroll to All <<<
Hi, Tom!
TC> in the center of the screen. I thought I could do this with BSAVE and
TC> BLOAD, but I have found that BSAVE needs to have an address and length
Forget it! Don't use B(SAVE/LOAD)! They require writing to a file!
It's not worth it -- you can't be sure that there's space for the file
and the disk isn't write protected, etc. Why not do something like this,
which I imagine is 100 times faster:....
Compile the below into a quick-library and load it into QuickBasic with /L
'-------
DECLARE SUB MemCopy ALIAS "B$ASSN" (BYVAL FSeg%, BYVAL
FOfs%, BYVAL NBytes1%, BYVAL TSeg%, BYVAL TOfs%, BYVAL
NBytes2%)
'-------
'Now, here's the sub...
DEFINT A-Z ' by Victor Yiu -- April 14, 1993
SUB ScreenSnip (SaveIt) STATIC ' pass in 1 for save, 0 for restore
' ... can be restored multiple times
IF Init = False THEN
Init = True
DIM Scrn(2000)
DEF SEG = 0
IF (PEEK(&H410) AND 48) <> 48 THEN
VidSeg = &HB800
ELSE
VidSeg = &HB00
END IF
DEF SEG
END IF
IF SaveIt THEN
MemCopy VidSeg, 0, 4096, VARSEG(Scrn), VARPTR(Scrn), 4096
ELSE
MemCopy VARSEG(Scrn), VARPTR(Scrn), 4096, VidSeg, 0, 4096
END IF
END SUB
'==============
Hope it helps!
Victor
... I know a good tagline when I steal one.
--- Blue Wave/RA v2.12 [NR]
* Origin: Hard Disc Cafe | Houston Texas | (713) 589-2690 | (1:106/30.0)

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