Click or drag to resize

MemoTran Function

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

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.08
Syntax
 FUNCTION MemoTran(
	 cTarget AS USUAL,
	 cReplaceHardCR AS USUAL,
	 cReplaceSoftCR AS USUAL
) AS STRING
View Source

Parameters

cTarget
Type: Usual
The string that contains the carriage-return/linefeed.
cReplaceHardCR
Type: Usual
The character to replace a hard carriage-return/linefeed pair with.  The default is a semicolon (;).
cReplaceSoftCR
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#
REPLACE _FIELD->Notes WITH MemoTran(_FIELD->Notes)
See Also