I am COMPLETELY new to the world of programming, but would like to know how to do so. I am starting a very simple program for my requirements in a certain subject for school, and would like to learn how to program for this project.
I’ve hit a bump, as I wanted the user to enter his/her name, and display this name on a different window, kind of saying “Hi …”. How can one do so? Thanks for the reply!
Thomas instructions use a dictionary but most of the time a string should be enough
Just make a modal dialog window with an input text field.
Make a prompt event on the window that shows the modal dialog box and returns a value.
The value returned must be a property on the window and not a control as the controls are destroyed before the return value makes it back from the method calling it.
Then you’re good to go!
WindowInputDialog.prompt(Message as string, DefaultInput as string = “”) return String
To use it, do something like:
Dim response as string = windowInputDialog.prompt(“Enter your username:”)
@Albin Kiland Unfortunately, when I write the code you provided, the debugging beforehand does not detect it, however, once I clicked the button (which contains the code), the program hangs. It does not show what the error is though.
Rene, instead of struggling with this for so long, why not go over the introduction for a few days? https://www.xojo.com/learn/
I think things will be a lot easier for you after the introduction. Especially because you said you were completely new to programming.