| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Replaces soft carriage returns with hard CRs in a character string.
HardCR( <cString> ) --> cConvertedString
The function returns <cString> with all soft carriage returns converted to hard carriage returns.
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.
| See also: | ?|??, @...SAY, MemoTran(), StrTran() |
| Category: | Character functions , Memo functions |
| Source: | rtl\hardcr.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// 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
http://www.xHarbour.com