(07-07-2023, 02:17 PM)James D Jarvis Wrote: I just wanted a simple programming method that was cross platform because it didn't require any API calls or even shell commands that may have been system specific, and it's also comprehensible to beginners.
Here I have shown 4 alternate methods not specifically intended for console.
https://qb64phoenix.com/forum/showthread...8#pid17118
This is pretty simple and should work on console:
Code: (Select All)
_Title "Multiple Input Menu demo" 'b+ 2021-06-11
Type InputItem
As String promptName, SValue
End Type
ReDim Shared nItems
nItems = 12 ' number of inputs plus 2 for quit and goto for processing inputs
' initial item names (like variables)
ReDim inps(1 To nItems) As InputItem
For i = 1 To nItems - 2
inps(i).promptName = "Demo Input Item #" + _Trim$(Str$(i))
Next
inps(nItems - 1).promptName = "Process Inputs"
inps(nItems).promptName = "Quit"
Do
Cls
For i = 1 To nItems
Print "#" + _Trim$(Str$(i)), inps(i).promptName;
If inps(i).SValue <> "" Then Print " = "; inps(i).SValue Else Print
Next
Print: Input "Enter choice # "; choice
If choice < nItems - 1 Then
Print "Please enter, " + inps(choice).promptName + " ";
Input inps(choice).SValue
End If
Loop Until choice >= nItems - 1 And choice <= nItems
Select Case choice
Case nItems: Print "You quit, goodbye!": End
Case nItems - 1
' <<< could check inputs here and handle errors
GoTo processInputs
End Select
processInputs:
' doit remember SValues are strings!
Print "Processing Inputs now..."
This allows user to edit their inputs by menu numbers until they press enter at last input item (enters on others just prompt next input item).
This is like for filling out a form without having to design a form.
b = b + ...