Ask a question with INPUT
PRINT, variables, loops and INPUT. Four short lessons to get started.
Try these BASIC examples in the Web IDE Terminal.
Ask, remember, respond
INPUT asks for a value and stores the response in a variable. This introductory example uses a string variable, marked by its $ suffix.
INPUT "What is your name"; name$
PRINT "Hello, " + name$ + "."If you enter Nate, the greeting is Hello, Nate.. Classic INPUT can add prompt punctuation; use a comma after the prompt to suppress the question mark.
Waiting should not freeze your workspace
In the Cortex design, a program can look as though it pauses at INPUT while the interface remains responsive. Input goes to a dedicated Terminal field or runtime overlay. STOP/BREAK must cancel the wait and return control.
A whole line is a different job
Classic BASIC also has LINE INPUT for reading a whole line of text. It is useful when spaces and punctuation are part of the input. Use HELP INPUT in Terminal for input syntax and behavior.
Bring the pieces together
Combine a greeting, a variable, and a loop into a short program. Save your project on this device and export a backup of your source. Read how Terminal and Editor work together.