BBS: Inland Empire Archive Date: 02-25-93 (22:11) Number: 142 From: JOE NEGRON Refer#: NONE To: JANUSZ SUCHOROLSKI Recvd: NO Subj: a Conf: (2) Quik_Bas
JN> Well, I don't understand just what it is you're trying to do, but here
> is a SUB that will clear the keyboard buffer:
JS> My approach to screen saving requires to pick up just a "square" of
> ASCII screen and saving it to a disk/HD. I.e. not the whole screen
> saver (trivial), but just a "window" of text to be saved. There must
> be a correlation between screen memory and row/col locations. Or is
> it just not universal enough, i.e. varies from one video card to
> another. Hope, you might have come across something of that nature
> in the past.
> ...
> X = SCREEN(ROW, COL) ' get character
> ...
Oh! OK, I understand.
Yes, there certainly is a faster way than using SCREEN(). Try adapting
the following routine:
============================== Begin code ==============================
DEFINT A-Z
DECLARE SUB GetScrn (TR%, BR%, LC%, RC%, Scrn%())
DIM Scrn%(0 TO 3999)
'***********************************************************************
'* SUB GetScrn
'*
'* PURPOSE
'* Saves a specified portion of the screen into an array from which
'* it can later be restored with SUB PutScrn.
'***********************************************************************
SUB GetScrn (TR%, BR%, LC%, RC%, Scrn%()) STATIC
DEF SEG = 0
'If 0000:0463 = B4, monitor is monochrome
DEF SEG = &HB000 - (PEEK(&H463) <> &HB4) * &H800
Element% = LBOUND(Scrn%)
UL% = (TR% - 1) * 160 + LC% * 2 - 2
LL% = (BR% - 1) * 160 + LC% * 2 - 2
FOR X% = UL% TO LL% STEP 160
FOR Y% = X% TO X% + (BR% - 1) * 160 + RC% * 2 - 2 - LL% + 1 STEP 2
Scrn%(Element%) = PEEK(Y%)
Scrn%(Element% + 1) = PEEK(Y% + 1)
Element% = Element% + 2
NEXT Y%
NEXT X%
DEF SEG
END SUB
=============================== End code ===============================
This is from my library of video-related routines. You'll notice that
SUB GetScrn saves the character attribute as well as the character
itself, something I don't think you want.
--Joe in Bay Ridge, Brooklyn, NY--
Thu 02-25-1993, 22:11
... A clear conscience is merely the result of bad memory.
___
X Blue Wave/QWK v2.12 X
--- Maximus 2.01wb
* Origin: * BlueDog BBS * (212) 594-4425 * NYC FileBone Hub (1:278/709)

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