Liberty BASIC Help Online

INPUT
 
INPUT  #handle  "string expression";  variableName
 
Description:
This command has several possible forms:
 
    input var
This form causes a program to stop and wait for user to enter data in the program's mainwin and press the 'Return' key.  It will then assign the data entered to var.
 
    input "enter data"; var 
This form will display the string "enter data" and then stop and wait for user to enter data in the program's mainwin and press 'Return'.  It will then assign the data entered to var.
 
    input #name, var
This form will get the next data item from the open file or device using handle named #handle and assign the data to var.  If no device or file exists that uses the handle named #handle, then INPUT returns an error.
 
input #name, var1, var2
This form causes the next two data items to be fetched and assigned to var1 and var2.
 
    line input #name, var$
The LINE INPUT statement will read from the file, ignoring commas in the input stream and completing the data item only at the next carriage return or at the end of file.  This is useful for reading text with embedded commas
 
Usage:
 
  'Display a text file
  filedialog "Open..." , "*.txt", filename$
  open filename$ for input as #text
[loop]
  if eof(#text) <> 0 then [quit]
  input #text, item$
  print item$
  goto [loop]
[quit]
  close #text
  print "Done."
  end
 
Arrays
In earlier versions of Liberty BASIC, INPUT could not be used to input data directly into arrays, only into the simpler variables.  For Liberty BASIC 3, that limitation no longer exists.  It is now possible to use Input and Line Input to fill arrays directly.  To input directly to an array:
 
    input array$(x)
 
It is also possible to use this method:
 
    input array$(x), string$, stuff(i)
 
Question Mark
Most versions of Microsoft BASIC implement INPUT to automatically place a question mark on the display in front of the cursor when the user is prompted for information:
 
  input "Please enter the upper limit"; limit
 
  produces:
 
    Please enter the upper limit ? |
 
Liberty BASIC makes the appearance of a question mark optional.
 
  input "Please enter the upper limit :"; limit
 
  produces:
 
    Please enter the upper limit: |
 
  and:  
 
input limit  
 
produces simply:
 
    ? |
 
In the simple form input limit, the question mark is inserted automatically, but if a prompt is specified, as in the above example, only the contents of the prompt are displayed, and nothing more.  If it is necessary to obtain input without a prompt and without a question mark, then the following will achieve the desired effect:
 
  input ""; limit
 
Additionally, in most Microsoft BASICs, if INPUT expects a numeric value and a non numeric or string value is entered, the user will be faced with a comment something like 'Redo From Start', and be expected to reenter.  Liberty BASIC does not automatically do this, but converts the entry to a zero value and sets the variable accordingly. 
 
The prompt may be expressed as a string variable, as well as a literal string:
 
  prompt$ = "Please enter the upper limit:"</