home *** CD-ROM | disk | FTP | other *** search
-
- 'This program demostrates one method of implementing the scrolling features
- 'of QBAccel(Tm) together with other functions found in the QBAccel
- 'library for QuickBASIC(tm) 4.5 from Microsoft(r).
-
- '...................................c o d e...................................
-
- 'create screen
- PCOPY 0, 1
-
- COLOR 14, 0, 0: CLS
- CALL Ticks(18)
- CALL left2rite(10, 0, 14, "QBAccel(Tm) Library Scrolling Demo 1.02")
- CALL Ticks(9)
- CALL left2rite(12, 0, 14, "Copyright(c)1992 Crady vonPawlak")
- CALL Ticks(9)
- CALL left2rite(14, 0, 14, "This program is most effective run in large directories")
- CALL Ticks(9)
- CALL left2rite(16, 0, 14, "Press any key to begin...")
-
- DO: LOOP WHILE INKEY$ = ""
-
- COLOR 11, 4: CLS
- DEFINT A-Z
- up$ = CHR$(0) + CHR$(72)
- dn$ = CHR$(0) + CHR$(80)
-
-
- cc = (16 * 1) + 15
-
- LOCATE 4, 20: COLOR 11, 1: PRINT "Press "; CHR$(24); " "; CHR$(25); " "; "keys to scroll. [ Esc ] to exit.";
-
- 'put a listing of all files in the current directory where we can get them
- d$ = "*.*"
- SHELL "dir *.* > dir.~~~"
- DIM dir$(200), d$(200)
- OPEN "dir.~~~" FOR INPUT AS #1
-
- DO UNTIL EOF(1)
-
- a = a + 1
- IF a > 200 THEN EXIT DO
- LINE INPUT #1, d$(a)
- test$ = LEFT$(d$(a), 1)
-
- IF test$ = "" OR test$ = " " OR test$ = "." THEN
- GOTO notfile
- ELSE total = total + 1: dir$(total) = LEFT$(d$(a), 12)
- END IF
- notfile:
- LOOP
- CLOSE #1
-
- 'create another window
- CALL GroWindow(33, 46, 5, 13, 2, 1, "r", 1, 11, 1, "", 1, 0, 1, 0)
- COLOR 15, 1
- FOR s = 1 TO 7
-
- 'use ZIPRINT for FAST screen printing
- LOCATE s + 5, 34: CALL ziPRINT(dir$(s), cc)
- NEXT
-
- CALL wipekbd
- DO
- k$ = INKEY$
- IF k$ = CHR$(27) THEN EXIT DO
-
- IF k$ = up$ THEN GOSUB up
- IF k$ = dn$ THEN GOSUB Down
- LOOP
-
- 'restore the screen page and exit
- SHELL "del dir.~~~"
- CALL Curtains(1)
-
- END: ' End demo.
-
- 'do the actual up/down scrolling of the disk directory
- up:
- IF start = 0 THEN
- up = s
- start = 1
- uptest = 1
- GOTO doUp
- END IF
- IF uptest = 0 THEN
- up = dn + 7
- uptest = 1
- ELSE up = up + 1
- END IF
- IF up > total THEN
- up = total
- BEEP
- RETURN
- END IF
-
-
- doUp:
- CALL scrollup(1, 31, 5, 33, 11, 44)
- LOCATE 12, 34: CALL ziPRINT(dir$(up), cc)
- dn = up - 7
- RETURN
-
- Down:
- IF start = 0 THEN
- BEEP
- RETURN
- END IF
- IF uptest = 1 THEN
- dn = up - 7: uptest = 0
- ELSE dn = dn - 1
- END IF
-
- IF dn <= 1 THEN
- dn = 1
- start = 0
- BEEP
- END IF
- CALL scrolldn(1, 31, 5, 33, 11, 44)
- LOCATE 6, 34: CALL ziPRINT(dir$(dn), cc)
- up = dn + 7
- RETURN
-
-
-
-
-