Console Multi_prompt Input - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Utilities (https://qb64phoenix.com/forum/forumdisplay.php?fid=8) +---- Thread: Console Multi_prompt Input (/showthread.php?tid=1768) |
Console Multi_prompt Input - James D Jarvis - 06-20-2023 Use the Console for multi-prompt inputs. The routine is shown here with a simple example. Code: (Select All) 'Console multi_input RE: Console Multi_prompt Input - mnrvovrfc - 07-07-2023 In a QB64 version earlier than v3.5 this method of getting input from the user would work well. Otherwise users would expect a pretty window to do that. Could almost call upon "yad" or "zenity" on Linux but either one has to be installed, if not then it has to be done in the way prescribed in this thread. Doesn't Windows have a way to display a dialog to receive input, at least like an "Input Box", or does it still have to be done with the API? Another thing is that the user of this presented program has to cooperate. What if he/she made a mistake and needs to start over, or he/she entered something in the "wrong" field? INPUT is almost never used these days because of it, and LINE INPUT is almost relegated to text file input. Those two keywords and "scanf()" and "gets()" in C and whatever looked like them became obsolete the moment the few full-screen editors came out such as the QBasic editor. This is to inform somebody who is getting acquainted with BASIC programming or with QB64, and understands that a program of this type could be for his/her own use only and knows how to do it right. RE: Console Multi_prompt Input - Ultraman - 07-07-2023 (07-07-2023, 01:58 AM)mnrvovrfc Wrote: In a QB64 version earlier than v3.5 this method of getting input from the user would work well. Otherwise users would expect a pretty window to do that. Could almost call upon "yad" or "zenity" on Linux but either one has to be installed, if not then it has to be done in the way prescribed in this thread.One can use PowerShell to make a dialog that returns the text input from the user. It can work well, provided the coder knows PowerShell decently enough. But WinAPI is my preferred method. Also, good thing mentioning Zenity. I've used it before in Linux through QB64 for doing all sorts of dialogs. It's a great tool. A little off topic, but I remember someone made a Zenity for Windows on GitHub and it was horrible. It kills all your environment variables and your PATH, totally ruining your PC. I had to use a restore point to fix everything. RE: Console Multi_prompt Input - James D Jarvis - 07-07-2023 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. RE: Console Multi_prompt Input - bplus - 07-07-2023 (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.php?tid=1693&pid=17118#pid17118 This is pretty simple and should work on console: Code: (Select All) _Title "Multiple Input Menu demo" 'b+ 2021-06-11 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. |