BBS: Inland Empire Archive Date: 03-03-93 (20:08) Number: 251 From: CHRIS TRACY Refer#: NONE To: ALL Recvd: NO Subj: SCROLL.BAS v2.0 1/3 Conf: (2) Quik_Bas
' Well... Here's version 2.0! The main new feature of this version
' is COLOR codes! MULTIPLE color codes! Now you can add any color code
' you want for your scrolling needs. SCROLL.BAS will simply scroll an
' array on the screen coordinates you specify. You can use the UP/DOWN
' arrow keys, PGUP, PGDN, HOME and END to scroll through the array. This
' can be VERY useful for any REFERENCE program you might make or something
' like that... You can use my code in whatever you want, just please try to
'give me a little credit... Thankx!
' - Chris
' Here goes!
________O_/________________________| SNIP |______________________\_O_______
O \ | HERE | / O
'This file created by PostIt! v4.0.
'>>> Start of page 1.
DECLARE SUB Scroll (Arry$(), Elements%, UpR%, Brw%, LfC%, Rgc%, Fore%,_
Back%, EndCode$)
'
' Here's a little demonstation...
'
DIM Arry$(10)
CLS
Arry$(0) = "&&1101This is Arry$(0) in Light Blue on Dark Blue"
'
' The color code is as follows:
' (&&) Color Code Designator
' (11) Foreground Color (Light Blue)
' (01) Background Color (Dark Blue)
'
Arry$(1) = "&&0007This is Arry$(1) in Black on Gray"
Arry$(2) = "&&0901This is Arry$(2) in Med. Blue on Dark Blue"
Arry$(3) = "&&1406This is Arry$(3) in Yellow on Brown"
Arry$(4) = "&&3003This is &&1203Arry$(4)&&3003 in Blinking Yellow on"+_
" Light Cyan"
Arry$(5) = "This is Arry$(5) in the default colors."
Arry$(6) = "This is Arry$(6) in the default colors."
Arry$(7) = "This is Arry$(7) in the default colors."
Scroll Arry$(), 7, 1, 3, 1, 75, 11, 2, CHR$(27)
' ^^^^^^^ ^ ^ ^ ^ ^^ ^^ ^ ^^^^^^^^
' | | | | | || || | ++++++++- Key to use to stop
' scrolling
' | | | | | || || +- Default Background Color
' | | | | | || ++- Default Foreground Color
' | | | | | ++- Right Column
' | | | | +- Left Column
' | | | +- Bottom Row To Scroll On
' | | +- Upper Row To Scroll On
' | +- Number Of Elements
' +- Array To Be Scrolled
SUB Scroll (Arry$(), Elements%, UpR%, Brw%, LfC%, Rgc%, Fore%, Back%,_
EndCode$)
DEFINT A-Z
'
' Scroll v2.0 - By Chris Tracy
' QBS Publishing - YES!!!
' Basic Code Cache - YES!!!
' Any other QB magazines - YES!!!
'
' New! Multiple color codes! Even if you don't use this routine, the
' multiple
' color code routine can be handy.
'
' Arry$() - This is the array (of type STRING) to be scrolled.
' NOTE: The first element MUST be 0.
' Elements% - The number of elements to use.
' Upr% - The upper row (1-25) to scroll on.
' Brw% - The bottom row (1-25) to scroll on.
' Lfc% - The left column (1-80) to scroll on.
' Rgc% - The right column (1-80) to scroll on.
' Fore% - The default foreground color if there are no color
' codes.
' Back% - The default background color if there are no color
' codes.
' EndCode$ - This is the ending code's code to use. Use it like
' this:
' Scroll Arry$(), 130, 1,25,1,79,7,0,CHR$(27)
' The CHR$(27) would make ESCape the ending code. To
' use
' another character, for instance, the F1 key is
' CHR$(0) + ";" so just use that instead of CHR$(27).
'
' The array must also have a color code. The format for the color codes
' is: &&[Foreground][Background]. The color code MUST be 6 charcters,
' so you must add the 0's to 0-9. For instance, to change to yellow on
' green. The color code would be &&1402 ... Multiple color codes are
' allowed in the array. NOTE! The array MUST have a color code,
' otherwise
' it will not be printed. This eliminates the need for the default
' colors.
'
' In the future I plan to have the routine check if there are color
' codes.
' If there are, then process them. If not, then just print the string
' with the default colors. I may also change the color codes to simply
' take 1 attribute (Foreground+16*Background (Note... That formula does
' not work for blinking...)).
'
' Let me know what you think on the QUIK_BAS echo!
'>>> Continued on page 2.
--- T.A.G. 2.6d Standard
* Origin: DangerBase ][ Programming Staff 412-438-4101 (1:2615/4@FIDONET.ORG)

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