Author Topic: How to leave an input line.  (Read 5783 times)

0 Members and 1 Guest are viewing this topic.

Offline TempodiBasic

  • Forum Resident
  • Posts: 1792
    • View Profile
Re: How to leave an input line.
« Reply #15 on: June 15, 2021, 05:30:32 pm »
Hi
it is so fine to see how different and similar approaches have been showed here for a customized input routine.

@bartok
as our friends have said it is no possible navigation trough the input lines if you use old standard INPUT/ LINE INPUT / INPUT$()  keywords. Please forgot them because you will not want a DOS  interface with black screen.
Programming isn't difficult, only it's  consuming time and coffee

Offline bartok

  • Newbie
  • Posts: 80
    • View Profile
Re: How to leave an input line.
« Reply #16 on: June 16, 2021, 08:48:21 am »
@Cobalt
I like the way you combined  a FOR NEXT  inside a DO LOOP

Here are a few mods.  Can enter text . Backspace works

up / down keys rotate now.

Code: QB64: [Select]
  1. 'Editable input example
  2. 'lets start with some base constants
  3. CONST Key_Right = 19712, Key_Left = 19200, Key_Up = 18432, Key_Down = 20480
  4. CONST TRUE = -1, FALSE = NOT TRUE
  5.  
  6. DIM Inputs(9) AS STRING 'for this example we will allow up to 10 inputs
  7.  
  8.  
  9. 'some prep work
  10. OPT = 0 'start on the first input line
  11.  
  12. 'start our loop up
  13.     KH = _KEYHIT 'keyboard input
  14.     IF KH < 0 THEN KH = 0 'negate any negative keyhit values
  15.  
  16.     FOR I = 0 TO 9 'loop through all our input options
  17.  
  18.         'double space the input lines for readability
  19.         LOCATE 1 + (I * 2), 1: PRINT "INPUT VALUE #"; I; "  -"; Inputs(I);
  20.  
  21.         'print a "cursor" to show which input user is on, use space$ to clear other lines
  22.         IF I = OPT THEN PRINT CHR$(176) + " " ELSE PRINT SPACE$(2)
  23.  
  24.     NEXT I
  25.  
  26.     'let us process which line the user is inputing
  27.     SELECT CASE KH
  28.         CASE 13 'enter to accept inputs
  29.             ExitFlag%% = TRUE
  30.         CASE 8 'backspace to clear this input
  31.  
  32.             Inputs(OPT) = LEFT$(Inputs(OPT), LEN(Inputs(OPT)) - 1)
  33.  
  34.         CASE Key_Up
  35.             IF OPT = 0 THEN OPT = 10
  36.             IF OPT > 0 THEN OPT = OPT - 1
  37.  
  38.         CASE Key_Down
  39.  
  40.             IF OPT < 10 THEN OPT = OPT + 1
  41.             IF OPT = 10 THEN OPT = 0
  42.  
  43.         CASE 32 TO 122
  44.             'now we are only going to allow 1 character inputs for this example
  45.             Inputs(OPT) = Inputs(OPT) + CHR$(KH)
  46.         CASE NOT 0 ' any other input(0 is no input)
  47.             BEEP 'invalid input
  48.     END SELECT
  49.     '-----------------------------------------------
  50.  
  51.     _LIMIT 30 'up date 30times a sec to save CPU use
  52.     IF KH = 27 THEN ExitFlag%% = TRUE 'exit this example
  53. LOOP UNTIL ExitFlag%%
  54.  

Added blinking cursor


Code: QB64: [Select]
  1. 'Editable input example
  2. 'lets start with some base constants
  3. CONST Key_Right = 19712, Key_Left = 19200, Key_Up = 18432, Key_Down = 20480
  4. CONST TRUE = -1, FALSE = NOT TRUE
  5.  
  6. DIM Inputs(9) AS STRING 'for this example we will allow up to 10 inputs
  7. DIM cp(30)
  8.  
  9.  
  10. 'some prep work
  11. OPT = 0 'start on the first input line
  12.  
  13. 'start our loop up
  14.     KH = _KEYHIT 'keyboard input
  15.     IF KH < 0 THEN KH = 0 'negate any negative keyhit values
  16.  
  17.     FOR I = 0 TO 9 'loop through all our input options
  18.  
  19.         'double space the input lines for readability
  20.         LOCATE 1 + (I * 2), 1: PRINT "INPUT VALUE #"; I; Inputs(I)
  21.  
  22.         IF I = OPT THEN
  23.             LOCATE 1 + (OPT * 2), cp(OPT) + 17: PRINT " "
  24.         END IF
  25.  
  26.     NEXT I
  27.     LOCATE 1 + (OPT * 2), cp(OPT) + 17, 1, 31, 31
  28.  
  29.  
  30.     'let us process which line the user is inputing
  31.     SELECT CASE KH
  32.  
  33.         CASE 13 'enter to accept inputs
  34.             ExitFlag%% = TRUE
  35.  
  36.         CASE 8 'backspace to clear this input
  37.             IF cp(OPT) > 0 THEN
  38.                 Inputs(OPT) = LEFT$(Inputs(OPT), LEN(Inputs(OPT)) - 1)
  39.                 cp(OPT) = cp(OPT) - 1
  40.             END IF
  41.  
  42.         CASE Key_Up
  43.             IF OPT = 0 THEN OPT = 10
  44.             IF OPT > 0 THEN OPT = OPT - 1
  45.  
  46.         CASE Key_Down
  47.  
  48.             IF OPT < 10 THEN OPT = OPT + 1
  49.             IF OPT = 10 THEN OPT = 0
  50.  
  51.         CASE 32 TO 122
  52.             'now we are only going to allow 1 character inputs for this example
  53.             Inputs(OPT) = Inputs(OPT) + CHR$(KH)
  54.             cp(OPT) = cp(OPT) + 1
  55.         CASE NOT 0 ' any other input(0 is no input)
  56.             BEEP 'invalid input
  57.     END SELECT
  58.     '-----------------------------------------------
  59.  
  60.     _LIMIT 30 'up date 30times a sec to save CPU use
  61.     IF KH = 27 THEN ExitFlag%% = TRUE 'exit this example
  62. LOOP UNTIL ExitFlag%%
  63.  

Why, if I add on the top of your code,

test& = _NEWIMAGE(_DESKTOPWIDTH, _DESKTOPHEIGHT, 32)
_DEST test&
SCREEN test&

the cursor is not blincking? A part from that, with _NEWIMAGE graphic screen, LOCATE in your program continues to work fine without changes. So it seems that cursorstart and cursorstop may have problems.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: How to leave an input line.
« Reply #17 on: June 16, 2021, 11:30:54 am »
Quote
So it seems that cursorstart and cursorstop may have problems.

In graphics screens.

Offline bartok

  • Newbie
  • Posts: 80
    • View Profile
Re: How to leave an input line.
« Reply #18 on: June 16, 2021, 12:08:45 pm »
In graphics screens.

yes, but adding \16 and \8 nothing changes. In my program, SCREEN test& (that is called SCREEN schermo&), is the screen where all the images are put, after they have been collected between them.
For example, the attached image of the first post, is the result of an image put 2 times (the 2 graphs) inside a larger image (with datas) finally put in turn on schermo&. I use schermo& to ask inputs to the user or to write some information, but it has to contain also images.

So, is there a way in order to have blinking cursor on test&(schermo&)?

I thounght that implementing navigability was easier and that the worst was over!

However, thanks you all, I have understood the examples and I have done what I wanted. A part from blinking cursor...

Hi
it is so fine to see how different and similar approaches have been showed here for a customized input routine.

@bartok
as our friends have said it is no possible navigation trough the input lines if you use old standard INPUT/ LINE INPUT / INPUT$()  keywords. Please forgot them because you will not want a DOS  interface with black screen.

apart from the fact that I adore DOS inferface with black screen...:D
apart from the fact that, even having implemented this new standar of input, my interface still seems a DOS interface with back screen...

but: implementing this flexible kind of input, is absolutely not a joke, above all if the real case requires well defined kind of inputs! So, if it is not necessary such a flexibility, I think "normal" INPUT is preferable.
« Last Edit: June 16, 2021, 12:24:31 pm by bartok »

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: How to leave an input line.
« Reply #19 on: June 16, 2021, 12:26:49 pm »
Well, when you have a graphics screen you can replace a blinking cursor with a B&W blinking BF box option for Line.
If cursor box is not in a cls screen loop that updates in fractions of seconds then use a timer to blink the box.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: How to leave an input line.
« Reply #20 on: June 16, 2021, 10:01:37 pm »
This concept isn't that complex.  Let me strip it down to the very basics for you guys:

Code: QB64: [Select]
  1. Dim result(1 To 3) As String
  2.  
  3. V = 1: T! = Timer
  4.     If V < 1 Then V = 3 Else If V > 3 Then V = 1 'stay in bounds of our array
  5.     If Timer > T! + 0.5 Then blink = Not blink: T! = Timer 'blink on and off timer
  6.     Cls
  7.     Print "Enter your name: "; result(1);: If V = 1 And blink Then Print "Û" Else Print
  8.     Print "Enter your age : "; result(2);: If V = 2 And blink Then Print "Û" Else Print
  9.     Print "Enter your sex : "; result(3);: If V = 3 And blink Then Print "Û" Else Print
  10.     Print "Esc to Accept Data and exit"
  11.     k = _KeyHit
  12.     Select Case k
  13.         Case 18432: V = V - 1 'up
  14.         Case 20480: V = V + 1 'down
  15.         Case 13: V = V + 1 'enter
  16.         Case 8: result(V) = Left$(result(V), Len(result(V)) - 1) 'backspace
  17.         Case 32 TO 255: result(V) = result(V) + Chr$(k) 'add character
  18.     End Select
  19.     _Limit 30
  20.     _Display
  21. Loop Until k = 27
  22. Print: Print "Your final data was:", result(1), result(2), result(3)
  23.  
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline bartok

  • Newbie
  • Posts: 80
    • View Profile
Re: How to leave an input line.
« Reply #21 on: June 17, 2021, 08:47:47 am »
This concept isn't that complex.  Let me strip it down to the very basics for you guys:

Code: QB64: [Select]
  1. Dim result(1 To 3) As String
  2.  
  3. V = 1: T! = Timer
  4.     If V < 1 Then V = 3 Else If V > 3 Then V = 1 'stay in bounds of our array
  5.     If Timer > T! + 0.5 Then blink = Not blink: T! = Timer 'blink on and off timer
  6.     Cls
  7.     Print "Enter your name: "; result(1);: If V = 1 And blink Then Print "Û" Else Print
  8.     Print "Enter your age : "; result(2);: If V = 2 And blink Then Print "Û" Else Print
  9.     Print "Enter your sex : "; result(3);: If V = 3 And blink Then Print "Û" Else Print
  10.     Print "Esc to Accept Data and exit"
  11.     k = _KeyHit
  12.     Select Case k
  13.         Case 18432: V = V - 1 'up
  14.         Case 20480: V = V + 1 'down
  15.         Case 13: V = V + 1 'enter
  16.         Case 8: result(V) = Left$(result(V), Len(result(V)) - 1) 'backspace
  17.         Case 32 TO 255: result(V) = result(V) + Chr$(k) 'add character
  18.     End Select
  19.     _Limit 30
  20.     _Display
  21. Loop Until k = 27
  22. Print: Print "Your final data was:", result(1), result(2), result(3)
  23.  

done! thank's!

Code: QB64: [Select]
  1. '[...]
  2. esci$ = "I dati forniti non determinao pioggia efficace, quindi non vi Š portata. Premere un tasto per uscire."
  3. SCREEN schermo&
  4. PRINT "Questo programma serve a calcolare l'idrogramma di progetto (e relativa portata di picco) per"
  5. PRINT "un  dato  tempo  di  ritorno,  utilizzando  l'idrogramma  unitario  adimensionale di Mockus e"
  6. PRINT "ietrogrammi tipo "; CHR$(34); "Chicago"; CHR$(34); " o "; CHR$(34); "costanti"; CHR$(34); "."
  7. PRINT "Di seguito si dovranno inserire i valori della curva di possibilit… climatica "; CHR$(34); "h = Ktúaúd^n"; CHR$(34); "."
  8. PRINT "Se  si dispone  dei valori  del Centro  Funzionale, digitare il valore "; CHR$(34); "Kt"; CHR$(34); " relativo al tempo"
  9. PRINT "di ritorno "; CHR$(34); "T"; CHR$(34); " d'interesse, con i relativi valori "; CHR$(34); "a"; CHR$(34); " e "; CHR$(34); "n"; CHR$(34); "."
  10. PRINT "Se invece si ha una  propria curva di possibilit… climatica, quando verr… chiesto di inserire"
  11. PRINT CHR$(34); "Kt"; CHR$(34); ", digitare "; CHR$(34); "INVIO"; CHR$(34); ", o "; CHR$(34); "1"; CHR$(34); "."
  12. PRINT "In tal caso "; CHR$(34); "Kt"; CHR$(34); " sar… considerato pari a "; CHR$(34); "1"; CHR$(34); " e "; CHR$(34); "T"; CHR$(34); " come "; CHR$(34); "definito dall'utente"; CHR$(34); "."
  13. PRINT "- Kt [-] (INVIO per 1)                                           = "
  14. PRINT "- a [mm/d^n]                                                     = "
  15. PRINT "- n [-] (0ö1)                                                    = "
  16. PRINT "- Area del bacino idrografico [mý]                               = "
  17. PRINT "- Lunghezza dell'asta principale del bacino idrografico [m]      = "
  18. PRINT "- Altitudine s.l.m. del punto pi— alto dell'asta principale [m]  = "
  19. PRINT "- Altitudine s.l.m. del punto pi— basso dell'asta principale [m] = "
  20. PRINT "- Pendenza media del bacino idrografico [%] (1ö100)              = "
  21. PRINT "- CN(II) [-] (1ö100)                                             = "
  22. PRINT "- Coefficiente delle perdite inziali [-] (0ö0.2 - INVIO per 0.1) = "
  23. CALL InserimentoDati(k!, a1!, n1, A2!, L!, HmaxL!, HminL!, s1!, CNII!, CoeffPerditeIniziali!)
  24. LOCATE PosizioneCursore% + 10, 1
  25. PRINT "- Visualizzare i risultati utilizzando lo ietogramma Chicago [1] o costante [2]?"
  26. '[...]
  27. SUB InserimentoDati (k!, a1!, n1, A2!, L!, HmaxL!, HminL!, s1!, CNII!, CoeffPerditeIniziali!)
  28.  
  29.     SHARED PosizioneCursore%
  30.  
  31.     DIM inputs$(10)
  32.     DIM richiesta%
  33.     DIM test%(10)
  34.     DIM debug%
  35.     DIM carattere$
  36.     DIM punti%
  37.     DIM T!
  38.     DIM cursore%
  39.     DIM esci%
  40.  
  41.     PosizioneCursore% = CSRLIN - 10
  42.     richiesta% = 1
  43.     T! = TIMER
  44.     DO
  45.         _LIMIT 30
  46.         KeyPress$ = INKEY$
  47.         IF TIMER > T! + 0.5 THEN
  48.             cursore% = NOT cursore%
  49.             T! = TIMER
  50.         END IF
  51.         FOR i% = 1 TO 10
  52.             LOCATE PosizioneCursore% - 1 + i%, 68: PRINT inputs$(i%) + SPACE$(30)
  53.         NEXT i%
  54.         IF esci% = 1 THEN EXIT DO
  55.         LOCATE PosizioneCursore% - 1 + richiesta%, 68 + LEN(inputs$(richiesta%))
  56.         IF cursore% THEN PRINT "_"
  57.         SELECT CASE KeyPress$
  58.             CASE CHR$(44), CHR$(46) ',e.
  59.                 punti% = 0
  60.                 IF KeyPress$ = CHR$(44) THEN KeyPress$ = CHR$(46)
  61.                 FOR n% = 1 TO LEN(inputs$(richiesta%))
  62.                     carattere$ = MID$(inputs$(richiesta%), n%, 1)
  63.                     IF carattere$ = CHR$(46) THEN punti% = 1
  64.                 NEXT n%
  65.                 SELECT CASE punti%
  66.                     CASE IS = 0
  67.                         inputs$(richiesta%) = inputs$(richiesta%) + KeyPress$
  68.                     CASE IS = 1
  69.                         inputs$(richiesta%) = inputs$(richiesta%)
  70.                 END SELECT
  71.             CASE CHR$(48) TO CHR$(57) '0-9
  72.                 inputs$(richiesta%) = inputs$(richiesta%) + KeyPress$
  73.             CASE CHR$(8) 'del
  74.                 SELECT CASE LEN(inputs$(richiesta%))
  75.                     CASE IS = 0
  76.                         EXIT SELECT
  77.                     CASE IS = 1
  78.                         inputs$(richiesta%) = ""
  79.                         LOCATE , 68: PRINT " "
  80.                     CASE ELSE
  81.                         inputs$(richiesta%) = LEFT$(inputs$(richiesta%), LEN(inputs$(richiesta%)) - 1)
  82.                         LOCATE , 68 + LEN(inputs$(richiesta%)): PRINT " "
  83.                 END SELECT
  84.             CASE CHR$(0) + "H" 'su
  85.                 GOSUB Valutavalore
  86.                 SELECT CASE test%(richiesta%)
  87.                     CASE IS = 0
  88.                         inputs$(richiesta%) = ""
  89.                     CASE IS = 1
  90.                         IF richiesta% = 1 THEN
  91.                             EXIT SELECT
  92.                         ELSEIF richiesta <= 10 THEN
  93.                             richiesta% = richiesta% - 1
  94.                         END IF
  95.                 END SELECT
  96.             CASE CHR$(0) + "P" 'giu'
  97.                 GOSUB Valutavalore
  98.                 SELECT CASE test%(richiesta%)
  99.                     CASE IS = 0
  100.                         inputs$(richiesta%) = ""
  101.                     CASE IS = 1
  102.                         IF richiesta% < 10 THEN
  103.                             IF inputs$(richiesta% + 1) <> "" THEN richiesta% = richiesta% + 1
  104.                         ELSE
  105.                             EXIT SELECT
  106.                         END IF
  107.                 END SELECT
  108.             CASE CHR$(13) 'invio
  109.                 GOSUB Valutavalore
  110.                 IF debug% = 1 THEN
  111.                     _AUTODISPLAY
  112.                     EXIT SUB
  113.                 END IF
  114.                 IF richiesta% <> 1 THEN
  115.                     IF LEN(inputs$(richiesta%)) = 0 THEN test%(richiesta%) = 0
  116.                 END IF
  117.                 SELECT CASE test%(richiesta%)
  118.                     CASE IS = 0
  119.                         richiesta% = richiesta%
  120.                         inputs$(richiesta%) = ""
  121.                     CASE IS = 1
  122.                         IF richiesta% = 10 THEN
  123.                             esci% = 1
  124.                         ELSE
  125.                             richiesta% = richiesta% + 1
  126.                         END IF
  127.                 END SELECT
  128.         END SELECT
  129.         _DISPLAY
  130.     LOOP
  131.     k! = VAL(inputs$(1))
  132.     a1! = VAL(inputs$(2))
  133.     n1! = VAL(inputs$(3))
  134.     A2! = VAL(inputs$(4))
  135.     L! = VAL(inputs$(5))
  136.     HmaxL! = VAL(inputs$(6))
  137.     HminL! = VAL(inputs$(7))
  138.     s1! = VAL(inputs$(8))
  139.     CNII! = VAL(inputs$(9))
  140.     CoeffPerditeIniziali! = VAL(inputs$(10))
  141.     IF k! = 1 THEN
  142.         T$ = "Definito dall'utente."
  143.     ELSE
  144.         GOSUB TrovaT
  145.     END IF
  146.     EXIT SUB
  147.     '-----------------------------------------------------------------------------------------------------------------------------------------------------------
  148.     Valutavalore:
  149.     test%(richiesta%) = 0 ' se 0 rimane nella richiesta in corso, se 1, cambia.
  150.  
  151.     SELECT CASE richiesta%
  152.         CASE 1
  153.             IF inputs$(1) = "123" THEN 'avvia debug
  154.                 'Cillian:
  155.                 'k! = 1: a1! = 1: n1! = 0.45596: A2! = 2641902: L! = 3300: HmaxL! = 1981: HminL! = 1062: s1! = 41.5: CNII! = 70:CoeffPerditeIniziali!=0.1
  156.                 k! = 2.34: a1! = 14.6653: n1! = 0.45596: A2! = 2641902: L! = 3300: HmaxL! = 1981: HminL! = 1062: s1! = 41.5: CNII! = 70: CoeffPerditeIniziali! = 0.1
  157.                 'pialong:
  158.                 'k! = 2.34:'a1! = 17.097811:'n1! = 0.497753:'A2! = 2509318:'L! = 2919:'HmaxL! = 1654:'HminL! = 388:'s1! = 0.663:'CNII! = 66:CoeffPerditeIniziali!=0.1
  159.                 GOSUB TrovaT
  160.                 debug% = 1
  161.                 RETURN
  162.             END IF
  163.             IF LEN(inputs$(richiesta%)) = 0 THEN
  164.                 IF KeyPress$ = CHR$(13) THEN inputs$(richiesta%) = "1"
  165.             END IF
  166.             test%(richiesta%) = 1
  167.         CASE 2, 4, 5, 6, 7
  168.             test%(richiesta%) = 1
  169.         CASE 3
  170.             IF VAL(inputs$(richiesta%)) <= 1 THEN
  171.                 test%(richiesta%) = 1
  172.             ELSE
  173.                 test%(richiesta%) = 0
  174.             END IF
  175.         CASE 8, 9
  176.             IF VAL(inputs$(richiesta%)) >= 1 THEN
  177.                 IF VAL(inputs$(richiesta%)) <= 100 THEN test%(richiesta%) = 1
  178.             ELSEIF inputs$(richiesta%) = "" THEN test%(richiesta%) = 1
  179.             ELSE
  180.                 test%(richiesta%) = 0
  181.             END IF
  182.         CASE IS = 10
  183.             IF LEN(inputs$(richiesta%)) = 0 THEN
  184.                 IF KeyPress$ = CHR$(13) THEN inputs$(richiesta%) = "0.1"
  185.                 test%(richiesta%) = 1
  186.             ELSE
  187.                 IF VAL(inputs$(richiesta%)) >= 0 THEN
  188.                     IF VAL(inputs$(richiesta%)) <= 0.2 THEN test%(richiesta%) = 1
  189.                 ELSE
  190.                     test%(richiesta%) = 0
  191.                 END IF
  192.             END IF
  193.     END SELECT
  194.     '-----------------------------------------------------------------------------------------------------------------------------------------------------------
  195.     TrovaT:
  196.     i% = 1
  197.     '[...]
  198.     RETURN
  199. '-----------------------------------------------------------------------------------------------------------------------------------------------------------
  200.  

I have implemented also the blinking cursor. But all of that is a very complecated stuff, in oder to do things likes these:
- transforms "," in "."
- not allow double "."
- not go DOWN if down the field is empty
- automatic cancel not allowed data
- etc

to do that, more then 200 lines of code!
« Last Edit: June 17, 2021, 09:24:08 am by bartok »

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: How to leave an input line.
« Reply #22 on: June 17, 2021, 04:33:12 pm »
Here's a little something which I tossed together in about 20 minutes this afternoon, which you might be able to use:

Code: QB64: [Select]
  1. Screen _NewImage(1280, 720, 32)
  2. Dim As String prompt(3), results(3)
  3. prompt(0) = "Name": prompt(1) = "Age": prompt(2) = "Sex": prompt(3) = "Phone Number"
  4. For i = 1 To 100 'Draw some stuff on the screen for a background
  5.     Line (Rnd * 1280, Rnd * 720)-(Rnd * 1280, Rnd * 720), _RGB32(Rnd * 255, Rnd * 255, Rnd * 255), BF
  6. Print "SLEEPING SO YOU CAN SEE OUR BACKGROUND"
  7. MultiInput 100, 100, prompt(), results(), 20
  8. Print: Print "As you can see, when finished, our pop up restored our background..."
  9. Print "And your answers were the following:"
  10. For i = 0 To UBound(results): Print results(i): Next
  11. Sub MultiInput (xPos, yPos, prompt() As String, results() As String, maxLength As Integer)
  12.     backupImage = _CopyImage(0) 'copy our screen
  13.     B = _Blend: _DontBlend: A = _AutoDisplay: u = UBound(prompt)
  14.     For i = 0 To u 'get box size
  15.         p = _PrintWidth(prompt(i)): If p > maxWidth Then maxWidth = p
  16.     Next
  17.     boxWidth = maxWidth + maxLength * _FontWidth + 10: boxheight = (u + 1) * (_FontHeight + 3)
  18.     Do
  19.         If Timer > t# + .5 Then blink = Not blink: t# = Timer
  20.         k = _KeyHit 'get input
  21.         Select Case k
  22.             Case 18432: selection = selection - 1: If selection < 0 Then selection = u 'up
  23.             Case 20480, 13: selection = selection + 1: If selection > u Then selection = 0 'down
  24.             Case 27: Exit Do 'esc is the exit/finish code
  25.             Case 8: results(selection) = Left$(results(selection), Len(results(selection)) - 1) 'backspace
  26.             Case 32 TO 255: results(selection) = results(selection) + Chr$(k) 'all else
  27.         End Select
  28.  
  29.         _PutImage , backupImage 'restore background
  30.         Line (xPos, yPos)-Step(boxWidth, boxheight), 0, BF: Line (x + xPos + maxWidth + 1, y + yPos)-Step(0, boxheight), -1 'draw box
  31.         For i = 0 To u
  32.             Line (x + xPos, y + i * (_FontHeight + 3) + yPos)-Step(boxWidth, _FontHeight + 3), -1, B
  33.             _PrintString (x + xPos + 2, y + i * (_FontHeight + 3) + yPos + 2), prompt(i)
  34.             If i = selection And blink Then out$ = results(i) + Chr$(219) Else out$ = results(i)
  35.             _PrintString (x + xPos + maxWidth + 3, y + i * (_FontHeight + 3) + yPos + 2), out$
  36.         Next
  37.         _Limit 30: _Display
  38.     Loop
  39.     _PutImage , backupImage
  40.     If B Then _Blend
  41.     _FreeImage backupImage

45 lines total, and  only 33 lines for our SUB, which does all the real work for us.

And what's this do, you ask?

It creates a simple, stand-alone, multi-line, POP-UP input box which we can use the arrow keys to move up and down between. 

Usage is rather simple:
1) Dim 2 arrays to hold your prompts and the results.
2) Set your prompts.
3) Call the function, get the results.

Can't be much simpler than that!
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!