Home  |  Delphi .net Home  |  System.Console  |  OpenStandardInput Method
  
OpenStandardInput  
Method  
Gets the Standard Input Stream writer
Console Class
System NameSpace
CF1.  Function OpenStandardInput : Stream; Static;
CF2.  Function OpenStandardInput ( BufferSize : Integer ) : Stream; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Gets the standard input text stream.
Notes
Static methods are not methods of an object - they are simply class functions or procedures available at any time.
Microsoft MSDN Links
System
System.Console
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
A simple example
program Project1;
{$APPTYPE CONSOLE}

uses
  System.IO;

var
  inReader : Stream;
  bytes    : Array[0..99] of Byte;
  count    : Integer;

begin
  inReader := Console.OpenStandardInput;

  // Ask the user for their name
  Console.WriteLine('What is your age?');

  // Get the age entered
  count := inReader.Read(bytes, 0, 100);

  // Display the data read
  Console.WriteLine('{0} bytes read', count.ToString);
  Console.WriteLine('Your age = ' + bytes);

  Console.ReadLine;
end.
   What is your age?
   47
   4 bytes read
   Your age = 47
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author