Home  |  Delphi .net Home  |  System.IO.StringWriter  |  Close Method
  
Close  
Method  
Closes the StringWriter
StringWriter Class
System.IO NameSpace
CF1.  Procedure Close ;
CF : Methods with this mark are Compact Framework Compatible
Description
Closes the StringWriter stream, calling the Dispose method to do so.
 
After closing the writer, an exception will be thrown if you try to write to it again.
Microsoft MSDN Links
System.IO
System.IO.StringWriter
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

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

uses
  System.IO;

var
  Writer           : System.IO.StringWriter;

begin
  // Create our String Writer
  Writer := System.IO.StringWriter.Create;

  // Write various things to our StringWriter
  Writer.WriteLine(27);
  Writer.WriteLine(true);
  Writer.WriteLine(DateTime.Create(2004, 9, 17));

  // Now display the contents
  Console.WriteLine(Writer.ToString);

  // Close the writer
  Writer.Close;

  Console.Readline;
end.
   27
   True
   17/09/2004 00:00:00
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author