streamwriter_object.NewLine Property

Sets or gets the NewLine property that controls how lines are terminated by the WriteLine method.

steamwriter_object.NewLine = <newline_string>
-or-
...steamwriter_object.NewLIne

Prerequisites

None

Parameters

None

Remarks

This property is a string of 0, 1 or 2 bytes that is appended to the end of any output performed by the streamwriter_object.WriteLine method. By default the NewLine value is a 2-byte string containing an ASCII CR character (decimal 13, GPL_CR) followed by an LF character (decimal value 10, GPL_LF). Typical settings for this property are CR, LF, or CR-LF. If set to an empty string, no terminator is added to the end of lines.

Examples

Dim pfile As New StreamWriter("/dev/com1")   ' Open serial port 1
pfile.NewLine = Chr(GPL_LF) ' Set terminator to LF (10)
.
.
.
pfile.NewLine = Chr(GPL_CR) ' Set terminator to CR (13)

See Also

File and Serial I/O | streamwriter_object.WriteLine