Click or drag to resize

HardCR Function

Replace all soft carriage returns (Chr(141)) in a string with hard carriage returns (Chr(13)).

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION HardCR(
	cString AS STRING
) AS STRING
View Source

Parameters

cString
Type: String
The string to convert.

Return Value

Type: String
Remarks
Soft carriage returns are added by MemoEdit() when lines wrap.  X# console commands, like REPORT and LABEL FORM, do not automatically convert soft carriage returns to hard carriage returns; therefore, in order to display long strings and memo fields containing soft carriage returns, you must convert them.
Examples
This examples uses HardCR() to display a memo field that has been formatted with the automatic word wrapping of MemoEdit():
X#
USE sales NEW
? HARDCR(sales->Notes)
This example formats a string:
X#
? HARDCR(_Chr(141) + _Chr(10))
// Result: _Chr(13) + _Chr(10)
See Also