# HB_OSNEWLINE()

Returns the newline character(s) to use with the current OS

Syntax

  HB_OSNewLine() --> cString

Returns

  <cString> A character string containing the character or characters required to move the screen cursor or print head to the start of a new line. The string will hold either CHR(10) or CHR(13) + CHR(10).

Description

  Returns a character string containing the character or characters required to move the screen cursor or print head to the start of a new line for the operating system that the program is running on (or thinks it is running on, if an OS emulator is being used).

Examples

          // Get the newline character(s) for the current OS using defaults.
          STATIC s_cNewLine
          ...
          s_cNewLine := HB_OSNewLine()
          ...
          OutStd( "Hello World!" + s_cNewLine )
          ...
    Tests
          valtype( HB_OSNewLine() ) == "C"
          LEN( HB_OSNewLine() ) == 1

Status

  Ready

Compliance

  This is an add-on Operating System Tool function.

Platforms

  Under OS_UNIX_COMPATIBLE operating system the return value is the Line-Feed (0x0a) character CHR(10), with other operating systems (like DOS) the return value is the Carriage-Return plus Line-Feed (0x0d 0x0a) characters CHR(13)+CHR(10).

Files

  Library is rtl

See Also

- OS()
- OUTSTD()
- OUTERR()