Defines the standard input text file System unit
  var Input : TextFile;
The Input variable is predefined by Delphi to refer to the standard text input file.
This is normally the console, but may be overriden to any file using the AssignFile statement.
Input is used in the text file Read, ReadLn and Seek routines. It may be omitted in these commands however, since it is the default file.
Related commands
$AppType Determines the application type : GUI or Console
Output Defines the standard output text file
Read Read data from a binary or text file
ReadLn Read a complete line of data from a text file
 Author links

 Download this web site as a Windows program.

Example code : Read and write to the console
program Project1;

{$AppType CONSOLE}


  name : string;

  // A console application has the console Input and Output
  // assigned and opened on our behalf.
  WriteLn(Output, 'Please enter your name');
  ReadLn(Input, name);

  // And we do not even have to refer to these file names
  WriteLn('Your name is '+name);
  WriteLn('Press enter to exit');
   Example console output :
   Please enter your name
   Joe Bloggs
   Your name is Joe Bloggs
   Press enter to exit
Delphi Programming Neil Moffatt 2002 - 2020. All rights reserved.  |  Home Page