INPUT

INPUT V

READS KEYS FROM KEYBOARD OR CHARACTERS OF A SYSTEM OBJECT AND ASSIGNS THEM TO THE VARIABLE V

  • Type: Command
  • Parameter: 1
  • Group: System

ACTION

The command INPUT assigns a value to a variable.

It has two valid syntaxes: INPUT V and INPUT "TEXT";V

It uses the input mean defined by the command INPUT_SOURCE_IS, which is the keyboard by default.

- If the input mean is the keyboard, the command INPUT stops the programm running and is awaiting data entry from operator. The data must be followed by the ENTER key. The value is then assigned to the variable.

- If the input mean is a system object, the data is automatically read from the system object and the programm is not stopped.

The syntax INPUT "TEXT";V has the same effect for V, but displays a text on the "print target", which is FORM0 by default. The system object called "print target" is defined by the command PRINT_TARGET_IS.

Moreover, the command INPUT has options:

- to repeat or not the data input if no value is entrered (INPUT_REDO_ON and INPUT_REDO_OFF),

- to display or not an interrogation mark (INPUT_MARK_ON and INPUT_MARK_OFF),

- to display or not the stroke keys (INPUT_VISIBLE_ON and INPUT_VISIBLE_OFF).

By default, the options are:

- INPUT_REDO_OFF: if no value is entered (only the key ENTER has been stroke or the system object called "data source" is empty), there is no new input and the variable V is set to 0 if V is a numeric variable and set to the empty string ("") if V is a string variable.

- INPUT_MARK_OFF: an interrogation mark is not displayed

- INPUT_VISIBLE_ON: the stroke keys are not displayed

SYNTAX: INPUT V

  • V = defined variable
  • INPUT "TEXT";V
  • V = defined variable
  • "TEXT" = displayed text

USE

  • The command INPUT is used to enter a data from the keyboard or from a system object.

ERROR

  • If V is not a defined variable.

EXAMPLE

dim age,name$

input "Enter your age"; age

print "Your age is : "+str$(age)

print "Enter your name"

input nom$

print "Your name is : "+nom$

SEE ALSO

INPUT_SOURCE_IS

INKEY$

SCANCODE

INPUT_MARK_ON

INPUT_MARK_OFF

INPUT_REDO_ON

INPUT_REDO_OFF

INPUT_VISIBLE_ON

INPUT_VISIBLE_OFF