TXTextControl.SaveToMemoryBuffer Method

Returns a buffer containing text data in a specified format. The buffer can be a string or a one-dimensional byte array. To inform Text Control which kind of buffer is to returned specify the buffer as the first parameter.

Syntax

TXTextControl.SaveToMemoryBuffer DataBuffer[, [Format[, CurSelection]]
Parameter Description
DataBuffer

Specifies a buffer that can be a string or a byte array. Text Control uses this parameter to get the type of the return buffer.

Format

Optional. Specifies a format identifier. When this parameter is not specified the data is saved in the internal Text Control format (3). See the Format parameter of the Save method for possible format identifiers.

CurSelection

Optional. When set to True the current selection is saved. When omitted or set to False or when no selection exists all the control contents are saved.

Return Value

The method returns a buffer, containing the saved data.

Data Types

DataBuffer:    String or One-dimensional Byte Array
Format:    Integer
CurSelection:    Boolean
Return value:    Same Type as DataBuffer

Example

This Basic example copies the currently selected text from the first Text Control and inserts it at the current input position of a second Text Control using RTF format:

Dim RTF As String
RTF = TXTextControl1.SaveToMemoryBuffer(RTF, 5, True)
TXTextControl2.LoadFromMemory RTF, 5, True

See Also