Click or drag to resize

MemoTran Function

X#
Replace carriage-return/linefeeds with a character that can be displayed.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION MemoTran(
	cTarget,
	cReplaceHardCR,
	cReplaceSoftCR
) AS STRING CLIPPER
Request Example View Source

Parameters

cTarget (Optional)
Type: Usual
The string that contains the carriage-return/linefeed.
cReplaceHardCR (Optional)
Type: Usual
The character to replace a hard carriage-return/linefeed pair with.
The default is a semicolon (;).
cReplaceSoftCR (Optional)
Type: Usual
The character to replace a soft carriage-return/linefeed pair with.
The default is a space.

Return Value

Type: String
A copy of cString with the specified carriage-return/linefeed pairs replaced.
Remarks
Carriage-return/linefeed characters are end-of-line formatting indicators placed in the string by MemoEdit(): Soft carriage returns (Chr(141)) are inserted when a line longer than the width of the MemoEdit() window wraps. Hard carriage returns (Chr(13)) are inserted when the user explicitly presses Enter. MemoTran() is particularly useful when displaying a memo field in a report form that does not wrap when a soft carriage return is encountered. MemoTran() resolves this by converting soft carriage returns to spaces.
Examples
This example strips all end-of-line characters from a memo field:
X#
1REPLACE _FIELD->Notes WITH MemoTran(_FIELD->Notes)
See Also