Re: NEED SOME CODE HELP

 BBS: Inland Empire Archive
Date: 03-07-93 (09:42)             Number: 2
From: JAMES VAHN                   Refer#: 372
  To: JIM MACALUSO                  Recvd: NO  
Subj: Re: NEED SOME CODE HELP        Conf: (2) Quik_Bas
JM>  Any suggestions? I have modified the editor.bas program i found in PC
JM>  Magazine Basic Techniques and Utilities but cant figure out how to be
JM>  able to use the arrow keys to move up or down a line and remember whats
JM>  on the lines ect...

Look into using PCOPY to save a screen and then restore it.

COLOR 7, 1 : CLS
LOCATE 5
PRINT "Press the up/down cursor keys, select a line with ENTER"
LOCATE 7 : selekt = 8
FOR l = 1 TO 9 : PRINT l;
FOR d = 1 TO 12 : PRINT CHR$(206);
NEXT : PRINT : NEXT
GOSUB Cruisin
LOCATE 11, 22 : PRINT " You selected line#"; selekt - 6
END

Cruisin:
DO
PCOPY 0, 1
LOCATE selekt, 1
Text$ = CHR$(28)

FOR TextIn = 2 TO 15
   Text$ = Text$ + CHR$(SCREEN(selekt, TextIn))  ' get text from screen
NEXT
COLOR 15, 0: PRINT Text$: COLOR 7, 1

ReadKey:
DO : k$ = INKEY$
LOOP UNTIL k$ <> ""
asc.val = ASC(RIGHT$(k$, 1))

 IF asc.val = 13 THEN RETURN               ' selection made!
 IF asc.val = 72 THEN selekt = selekt - 1  ' up cursor
 IF asc.val = 80 THEN selekt = selekt + 1  ' down cursor
 IF selekt > 14 THEN selekt = 8
 IF selekt < 8 THEN selekt = 14

PCOPY 1, 0
LOOP


 * SLMR 2.1a *
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