Console Multi_prompt Input
#1
Use the Console for multi-prompt inputs.
The routine is shown here with a simple example.
Code: (Select All)
'Console multi_input
'
'an example program for a routine to use the console window for multi-line input prompts
$Console
_Console Off 'turn off the console for now
_Delay 0.1
Print "Press any key when ready."
Sleep
Cls
Dim p$(5), aa$(5)
'setup the input prompts
p$(1) = "First Name : "
p$(2) = "Middle     : "
p$(3) = "Last Name  : "
p$(4) = "Street     : "
p$(5) = "City/Town  : "
multi_input "Multi_Input Sample", p$(), aa$()
Print aa$(3); ", "; aa$(1); " "; aa$(2)
Print aa$(4); ", "; aa$(5)
End

Sub multi_input (cptitle$, prompt$(), ia$())
    'cptitle$ is the console prompt title
    'prompt$() array of prompts
    'ia$() array of input data
    ind& = _Dest 'get the screen
    _Console On 'turn the console back on
    If cptitle$ = "" Then _ConsoleTitle "Prompt" Else _ConsoleTitle cptitle$ 'set the console title
    _ScreenHide 'hide the mainscreen
    _Dest _Console
    Cls 'clear the console
    mi = UBound(prompt$) 'check how many entries are being asked for
    For n = 1 To mi 'print the prompts
        Print prompt$(n)
    Next n
    Locate 1, 1 'reset cursor to top left corner
    For n = 1 To mi 'reprint prompts and get the input
        Print prompt$(n);
        Input ia$(n)
    Next n
    _ScreenShow
    _Dest ind&
    _Console Off
End Sub
Reply


Messages In This Thread
Console Multi_prompt Input - by James D Jarvis - 06-20-2023, 02:21 PM
RE: Console Multi_prompt Input - by mnrvovrfc - 07-07-2023, 01:58 AM
RE: Console Multi_prompt Input - by Ultraman - 07-07-2023, 12:26 PM
RE: Console Multi_prompt Input - by bplus - 07-07-2023, 03:27 PM



Users browsing this thread: 1 Guest(s)