Skip to main content

Input

Accepts input and stores it in a variable.

Synopsis

Input data

Arguments

data Either the name of a variable used to receive the data input, or a quoted string specifying the data.

Description

The Input statement inputs a literal data value. It can interactively receives a data value from the user into a variable, or it can input a specified quoted string.

Input with a variable cannot be used in a program running in background. Program execution is paused until the user indicates the end of data input and submits the data value by pressing the Return key.

Input does not time out.

The ObjectScript READ command provides more extensive support for interactive user input.

Examples

The following example illustrates the interactive use of the Input statement:

Println "Type your name, then press Return"
Input namevar
Println "Thanks ",namevar

The following example illustrates the background use of the Input statement:

Println "Here's the name"
Input "Fred"
Println
Println "Thanks "

See Also

  • Basic: Print statement

  • ObjectScript: READ command

FeedbackOpens in a new tab