WriteInteger(Value: Integer);
Value. The integer value that must be written.
The WriteInteger method writes integer number into a text file.
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(0, 100));
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: