ITextWriter.WriteInteger

Syntax

WriteInteger(Value: Integer);

Parameters

Value. The integer value that must be written.

Description

The WriteInteger method writes integer number into a text file.

Example

Sub UserProc;
Var
    f: IFileStream;
    TxtWriter: ITextWriter;
Begin
    f := New FileStream.Create("c:\File.txt", FileOpenMode.Create, FileShare.Exclusive);
    TxtWriter := New TextWriter.Create(f);
    TxtWriter.WriteString("Random value:");
    TxtWriter.WriteInteger(Math.RandBetweenI(0100));
    TxtWriter.Flush;
    Dispose f;
End Sub UserProc;

On executing the example a new text file File.txt is created. A random integer number is written to the file.

See also:

ITextWriter