Choose file from screen

 BBS: Inland Empire Archive
Date: 02-14-93 (10:11)             Number: 255
From: RICHARD DALE                 Refer#: NONE
  To: ALL                           Recvd: NO  
Subj: Choose file from screen        Conf: (2) Quik_Bas
I forgot who was asking for it, but here is a method of choosing a
filename from the screen.

It's in numbered-line BASIC, but it should be simple enough to convert
over to QuickBASIC.  I keep meaning to do it, but never get a
round tuit.


9010 CLS:COLOR 14,0:FILES "*.*"
9020 FOR GX = 2 TO 22: IF SCREEN(GX, 1) = 32 THEN GL = GX - 1:
     LOCATE GX,1: PRINT SPACE$(20): PRINT SPACE$(20): GOTO 9030
9030 NEXT GX: GROW = 2: GCOL = 1: COLOR 3, 0: LOCATE 23, 9:
     PRINT "<- This file?  Use arrow keys to select, <R> to Recall,
     or <ESCAPE>"
9040 IF SCREEN(GROW,GCOL) = 32 THEN 9120
9050 GFILE$ = "": FOR GX = 0 TO 11: GFILE$ = GFILE$ + CHR$(SCREEN(GROW,
     GCOL + GX)): NEXT GX
9060 COLOR 0,7: LOCATE GROW, GCOL + 13: PRINT "<-": COLOR 14, 0:
     LOCATE 23, 1: PRINT LEFT$(GFILE$, 8)
9070 GKEY$ = RIGHT$(INKEY$, 1): IF GKEY$ = "" THEN 9070
9080 IF GKEY$ = CHR$(27) THEN GFILE$ = "": GOTO 9170
9090 IF GKEY$ = "R" OR GKEY$ = "r" THEN 9170
9100 IF INSTR("HPKM", GKEY$) = 0 THEN 9070
9110 LOCATE GROW, GCOL + 13: PRINT SPACE$(2);
9120 IF GKEY$ = "H" THEN GROW = GROW - 1: IF GROW < 2 THEN GROW = GL
9130 IF GKEY$ = "P" THEN GROW = GROW + 1: IF GROW > GL THEN GROW = 2
9140 IF GKEY$ = "K" THEN GCOL = GCOL - 18: IF GCOL < 1 THEN GCOL = 55
9150 IF GKEY$ = "M" THEN GCOL = GCOL + 18: IF GCOL > 55 THEN GCOL = 1
9160 GOTO 9040
9170 RETURN


Day 22: America Held Hostage

 * DeLuxe2 1.26b #2989 * Bill Clinton:  The Dan Quayle of Presidents
--- FidoPCB v1.4 beta
 * Origin: Sound Advice - 24 Nodes (816)436-4516 (1:280/333)
Outer Court
Echo Basic Postings

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