07-07-2023, 12:26 PM
(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.
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.
Schuwatch!
Yes, it's me. Now shut up.
Yes, it's me. Now shut up.