xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HardCR()

Replaces soft carriage returns with hard CRs in a character string.

Syntax

HardCR( <cString> ) --> cConvertedString

Arguments

<cString>
A character string to be converted.

Return

The function returns <cString> with all soft carriage returns converted to hard carriage returns.

Description

Soft carriage returns (Chr(141)+Chr(10)) are inserted into a string by MemoEdit() when a line wraps during editing. The string returned from MemoEdit() retains soft carriage returns and is usually stored in a memo field. When such a string must be printed or displayed with another function than MemoEdit(), it is necessary to replace soft carriage returns with hard carriage returns (Chr(13)+Chr(10)) since soft carriage returns are not interpreted as end of line characters.

Note:  when a memo field is output using a proportional font, use MemoTran() to replace soft carriage returns with a space character.

Info

See also:?|??, @...SAY, MemoTran(), StrTran()
Category: Character functions , Memo functions
Source:rtl\hardcr.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays a memo field previously formatted with the
// automatic word wrapping of MemoEdit().

   PROCEDURE Main
      USE Customer NEW
      ? HardCR( Customer->Notes )
      USE
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe