QB / QB64 Discussion Forum     RULES     Other Subforums, Links and Downloads    Index of Threads

 Return to Index  

Simple scrolling text displayer.

February 4 2006 at 11:41 PM
  (Login NEWK1234)
R

I guess its been a while since anyone here has seen any of my programs, so I thinks its hight time I contributed something. This is a very simple scrolling text file displayer. It has a few bugs, but it works fine.

I would love suggestions to make it better, but please, don't totaly re-write the program for me. I;d like at least some of the origianl code to remain intact. Thanks and....
May the Force be with y'all!

The controls are fairly self-explanatory:
Up and Down arrow keys are used for scrolling
Enter ends the program.

CLS
INPUT "What is the path to the file you wish to be displayed"; filename$
OPEN filename$ FOR INPUT AS #1
DIM COOL$(1000)
DO
num = num + 1
IF EOF(1) THEN EXIT DO
LINE INPUT #1, lin$
COOL$(num) = lin$
LOOP
maxnum = 20

start:
num = 0
WHILE num < maxnum
num = num + 1
PRINT COOL$(num)
WEND
WHILE KEYPRESS$ <> CHR$(13)
KEYPRESS$ = INKEY$
IF KEYPRESS$ = CHR$(0) + CHR$(80) THEN maxnum = maxnum + 1
IF KEYPRESS$ = CHR$(0) + CHR$(80) THEN GOTO start
IF KEYPRESS$ = CHR$(0) + CHR$(72) THEN maxnum = maxnum - 1
IF KEYPRESS$ = CHR$(0) + CHR$(72) THEN GOTO start
IF maxnum < 0 THEN maxnum = 0
WEND

CLOSE


 
 Respond to this message   
Response TitleAuthorDate
 Read me please Feb 4, 2006
  The URL you posted is incorrect, mathew2_1 (URL*) Feb 9, 2006