'===========================================================================
' Subject: SIMPLE BANNER SCROLL               Date: 09-05-95 (16:43)       
'  Author: The ABC Programmer                 Code: QB, QBasic, PDS        
'  Origin: Used within the ABC Reader       Packet: TEXT.ABC
'===========================================================================
' Simple Banner Scroll by William Yu 09-05-1995
' Scrolls a line of text from right to left

DEFINT A-Z
DECLARE SUB Delay (Seconds!)
DECLARE SUB BannerScroll (Text$, ForeColor, BackColor, BeginCol, EndCol, Row)

CLS

' Make sure you add a trailing space at the end of TEXT$

Text$ = "Hello, my name is William Yu, and I'm The ABC Programmer. "
ForeColor = 15
BackColor = 0
BeginCol = 70
EndCol = 20
Row = 25

BannerScroll Text$, ForeColor, BackColor, BeginCol, EndCol, Row

SUB BannerScroll (Text$, ForeColor, BackColor, BeginCol, EndCol, Row)

' Since this is a banner scroll, the starting point is always the highest
' If not then we exit the subroutine

IF EndCol >= BeginCol THEN EXIT SUB

DEF SEG = &HB800       ' You must have a Color Monitor to use POKE

Y = 0
FOR X = BeginCol TO EndCol STEP -1
    Y = Y + 1
    LOCATE Row, X: COLOR ForeColor, BackColor: PRINT LEFT$(Text$, Y);
' If you like, you can have multiple colors
' To do this you POKE the color attribute to anything you want
' Here's an example, you'll have to modify it to suit your banner method
    POKE 3977, 7
    POKE 3979, 8
' Another way is to use random colors or define colors in an array.
    Delay .1
NEXT X
Y = 1
H = BeginCol - EndCol + 1
E = LEN(Text$)
DO
  Y = Y + 1
  LOCATE Row, EndCol: COLOR ForeColor, BackColor: PRINT MID$(Text$, Y, H);
  Delay .1
LOOP UNTIL Y = E

END SUB

DEFSNG A-Z
SUB Delay (Seconds)
  Time = TIMER
  XDELAY = Time + Seconds
  WHILE NOT (TIMER > XDELAY)
  WEND
  IF INKEY$ <> "" THEN END
END SUB

