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.


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

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.


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.


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


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