qb45advr.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
INPUT Statement Details
  QuickSCREEN      Details      Example      Contents      Index
──────────────────────────────────────────────────────────────────────────────
INPUT Statement Details
 
Syntax
  INPUT[;]["promptstring"{;|,}]variablelist
 
  Argument       Description
  ;              A semicolon immediately after INPUT keeps the cursor
                 on the same line after the user presses ENTER.
  promptstring   A string constant printed before the prompt
                 character.
  ;              Prints a question mark at the end of the
                 promptstring.
  ,              Prints the promptstring without a question mark.
  variablelist   A list of variables, separated by commas, to accept
                 the input values. See the discussion below.
 
The INPUT statement causes the program to pause and wait for data.
You can then enter the required data at the keyboard.
 
The data that you enter is assigned to the variables in variablelist.
The number of data items that you supply must be the same as the
number of variables in the list. The first character encountered after
a comma that is not a space, carriage return, or line feed is assumed
to be the start of a new item.
 
The variable names in the list may be numeric- or string-variable
names (including subscripted variables), array elements, or elements
of records. The type of each data item that you input must agree with
the type of the variable. (Strings input to an INPUT statement
need not be surrounded by quotation marks.) If this first character
is a quotation mark ("), the string item will consist of all
characters read between the first quotation mark and the second. This
means a quoted string may not contain a quotation mark as a character.
If the first character of the string is not a quotation mark, the
string is an unquoted string and terminates on a comma, carriage
return, or line feed.
 
Input stored in elements of a record must be input as single elements:
 
  TYPE Demograph
     FullName AS STRING * 25
     Age  AS INTEGER
  END TYPE
 
  DIM Person AS Demograph
  INPUT "Enter name and age: ";Person.FullName,Person.Age
 
Responding to an INPUT statement with too many or too few items,
or with the wrong type of value (for example, numeric instead of
string), produces an error message which reads "Redo from start."
 
No assignment of input values is made until you give an acceptable
response.
 
It is possible to edit a line of input before you press ENTER. The
following list describes the key combinations that allow you to
move the cursor, delete text, and insert text on the input line:
 
  Keys                Action commands, INPUT statement
 
  CTRL+ or RIGHT     Moves cursor one character to the right.
 
  CTRL+] or LEFT      Moves cursor one character to the left.
 
  CTRL+F or           Moves cursor one word to the right.
  CTRL+RIGHT
 
  CTRL+B or           Moves cursor one word to the left.
  CTRL+LEFT
 
  CTRL+K or HOME      Moves cursor to the beginning of the input line.
 
  CTRL+N or END       Moves cursor to the end of the input line.
 
  CTRL+R or INS       Toggles insert mode on and off. When insert
                      mode is on, characters above and to the right
                      of the cursor are shifted to the right as new
                      characters are entered.
 
  CTRL+I or TAB       Tabs right and inserts (insert mode on), or
                      overwrites (insert mode off).
 
  DEL                 Deletes the character at the cursor.
 
  CTRL+H or           Deletes the character to the left of the
  BACKSPACE           cursor, unless the cursor is at the beginning
                      of the input, in which case it deletes the
                      character at the cursor.
 
  CTRL+E or CTRL+END  Deletes to the end of the line.
 
  CTRL+U or ESC       Deletes entire line, regardless of cursor
                      position.
 
  CTRL+M or RETURN    Stores input line.
 
  CTRL+T              Toggles function key label display on and off
                      at bottom of screen.
 
  CTRL+BREAK or       Terminates input (exits compiled program).
  CTRL+C