Click or drag to resize

HardCR Function

X#
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.19
Syntax
 FUNCTION HardCR(
	cString AS STRING
) AS STRING
Request Example 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#
1USE sales NEW
2? HARDCR(sales->Notes)
This example formats a string:
X#
1? HARDCR(_Chr(141) + _Chr(10))
2// Result: _Chr(13) + _Chr(10)
See Also