WriteLnInteger(Value: Integer);
Value. The integer value that mast be written.
The WriteLnInteger method writes an integer value into a text file with further cursor move to the next string.
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("X:");
TxtWriter.WriteLnInteger(Math.RandBetweenI(0, 100));
TxtWriter.WriteString("Y:");
TxtWriter.WriteLnInteger(Math.RandBetweenI(0, 100));
TxtWriter.Flush;
Dispose f;
End Sub UserProc;
On executing the example a new text file File.txt is created. Two strings are written to the file. Each string contains the random number.
See also: