Welcome to the Forum!
makes sense in a terminal or command-line program. But remember, you’re building a web page, instead. There is no text-based terminal window for
input to use.
Instead, there is a web page, with whatever widgets you put there. Those widgets are the on-screen objects that can display your prompts, and receive your user’s keystrokes.
This can be a big conceptual leap, if you haven’t built any graphical programs before. If so, give it time. There are lots of new ideas, and it can take awhile to make them all connect together, well, in your head.
The biggest leap, for me, was sometimes called The Hollywood principle: “don’t call us, we’ll call you.” This turns conventional programming on its head.
- In a conventional (imperative) program, the program dictates what happens, in what order, from start to finish. The program calls upon the computer (and other things in its environment) to make that happen.
input assumes that this is the case.
- But in a graphical program, the user is in control. They decide what to click on, where to type, and so on; and it’s the program’s job to respond to such calls-to-action. Suddenly, it’s not the program calling on its environment; the environment calls the program! This is the world that GUI programs work in, including what you write in Anvil.