Skip to content
Andrew Owen edited this page May 30, 2023 · 2 revisions

INPUT


INPUT [;] [prompt {;|,}] var_0 [, var_1] ...

Prints prompt to the screen and waits for the user to input values for the specified variables. The semicolon before the prompt, if present, stops a newline from being printed after the values have been entered. If the prompt is followed by a semicolon, it is printed with a trailing ?. If the prompt is followed by a comma, no question mark is added.

Parameters

  • prompt is a string literal.
  • var_0, var_1, ... are variable names or fully indexed array elements.

Notes

  • Values entered must be separated by commas. Leading and trailing whitespace is discarded.
  • String values can be entered with or without double quotes (").
  • If a string with a comma, leading or trailing whitespace is needed, quotes are the only way to enter it.
  • Between a closing quote and the comma at the end of the entry, only white- space is allowed.
  • If quotes are needed in the string itself, the first character must be neither a quote nor whitespace. It is not possible to enter a string that starts with a quote through INPUT.
  • If a given var_n is a numeric variable, the value entered must be number literal.
  • Characters beyond the 255th character of the screen line are discarded.
  • If user input is interrupted by Ctrl+Break, CONT will re-execute the INPUT statement.

Errors

  • If the value entered for a numeric variable is not a valid numeric literal, or the number of values entered does not match the number of variables in the statement, ?Redo from start is printed and all values must be entered again.
  • A Syntax error that is caused after the prompt is printed is only raised after the value shave been entered. No values are stored.

Welcome to the SE BASIC wiki


  • Press RETURN to return to this menu.
  • Enter the name of a TOPIC to display it.
  • Enter EXIT to return to BASIC.

Choose from the following topics:

  1. Quick start guide: QUICK
  2. User's guide: USER
  3. Configuration guide: CONFIG
  4. Language guide: LANGUAGE
  5. Language reference: BASIC
  6. Technical reference: TECH
  7. Developer's guide: DEV
  8. Acknowledgemets: CREDITS
  9. Licenses: LICENSE
Clone this wiki locally