INPUT and LINPUT

INPUT and LINPUT are commands used to get user text input, with a few key differences.

Syntax
INPUT "guiding string";var[,var2[,st$...]] LINPUT "guiding string";st$

INPUT
INPUT gets text or numerical input from the user and stores it to a variable. The programmer can optionally specify a text string describing what the user wants entered.

Number input example :INPUT NUM 'ask for a number : PRINT "Number:";NUM ? 555 Number:555 OK

String input with optional text argument. :INPUT "Name";NAME$ 'ask for a string : PRINT "Hello, ";NAME$;"!" Name? STEVE Hello, STEVE! OK

If the user provides text input in place of numerical input, or the input is formatted incorrectly, then input will prompt the user to restart. (This will repeat until the user enters valid input.) :INPUT NUM : PRINT "Number:";NUM ? HELLO ?Redo from start ? 555 Number:555 OK

INPUT will throw an overflow error if a number is entered that exceeds the maximum number Petit Computer allows (about 524287.999) :INPUT NUM ? 999999 Overflow (1, INPUT) OK

INPUT can accept multiple variables at the same time, with the user separating them with commas. :INPUT "Name, age";NAME$,AGE : PRINT NAME$;" is ";AGE;" years old!" Name, age? STEVE, 10 STEVE is 10 years old! OK Note that the commas are necessary for INPUT to work with multiple variables: otherwise, "?Redo from start" is displayed.

LINPUT
LINPUT behaves similarly to input, with the exception that it will only accept a single string variable, and can accept commas. :LINPUT ST$ :PRINT ST$ ? look at this input,,,, look at this input,,,,