Category : BASIC Source Code
Archive   : BAS_INT1.ZIP
Filename : SCROLBOX.BAS

 
Output of file : SCROLBOX.BAS contained in archive : BAS_INT1.ZIP
'============================================================================
' Date : 25-Feb-91
' From : Larry Stone
'Subject : Scrolling

'Below is code that will let you scroll ANY window area; you simply tell
'the routines top, bottom, left, and right sides of the window and how
'many lines to scroll and, what color attributes to set in the scrolled
'area. Note that BASIC will not be informed of this color and,
'consequently, when you print to the scrolled area, BASIC will print with
'the last BASIC color values established. Also note that unlike BASIC's
'VIEW PRINT command, you could draw a box and call the ScrollWindowUp or
'ScrollWindowDown routines to scroll within the box - leaving the box
'undisturbed. Final note: The below routines will not help you once you
'have shelled to DOS or another program.
'===========================================================================

DECLARE FUNCTION ColorAttr% (Fg%, Bg%)
DECLARE SUB ScrollWindowDown (Trow%, Lcol%, Brow%, Rcol%, HowMany%, Fg%, Bg%)
DECLARE SUB ScrollWindowUp (Trow%, Lcol%, Brow%, Rcol%, HowMany%, Fg%, Bg%)

' $INCLUDE: 'qb.bi'

DEFINT A-Z


FUNCTION ColorAttr% (Fg%, Bg%) STATIC

'**** Convert Foreground & Background colors to a screen attribute.
BColr% = Bg% * 16 'Put Back color into range
FColr% = Fg% 'Set forground color
IF FColr% > 15 THEN BColr% = BColr% + 128 'If blink attr, put into Back
FColr% = FColr% AND 15 'Remove blink from Fore
ColorAttr% = FColr% + BColr% 'Create attribute integer

END FUNCTION

SUB ScrollWindowDown (Trow%, Lcol%, Brow%, Rcol%, HowMany%, Fg%, Bg%)

DIM reg AS RegType 'Setup the registers
reg.ax = &H700 + HowMany% 'Scroll down HowMany% lines
reg.bx = ColorAttr%(Fg%, Bg%) * 256 'Color attribute of new line
reg.cx = (Trow% - 1) * 256 + Lcol% - 1 'Upper left corner
reg.dx = (Brow% - 1) * 256 + Rcol% - 1 'Lower right corner
intNo% = &H10 'DOS Video BIOS service
CALL Interrupt(intNo%, reg, reg)

END SUB

SUB ScrollWindowUp (Trow%, Lcol%, Brow%, Rcol%, HowMany%, Fg%, Bg%)

DIM reg AS RegType 'Setup the registers
reg.ax = &H600 + HowMany% 'Scroll up HowMany% lines
reg.bx = ColorAttr%(Fg%, Bg%) * 256 'Color attribute of new line
reg.cx = (Trow% - 1) * 256 + Lcol% - 1 'Upper left corner
reg.dx = (Brow% - 1) * 256 + Rcol% - 1 'Lower right corner
intNo% = &H10 'DOS Video BIOS service
CALL Interrupt(intNo%, reg, reg)

END SUB


  3 Responses to “Category : BASIC Source Code
Archive   : BAS_INT1.ZIP
Filename : SCROLBOX.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/