User Tools

Site Tools


gettextrtf_code_template.htm
Navigation:  Templates > Guide to all Templates > Additional Libraries and Templates > Rich Text Template Support - Overview >====== GetTextRTF code template ====== Previous pageReturn to chapter overviewNext page

NoteBox.jpg

This template (and its associated code templates) has been deprecated, and is now replaced by the RTF Text Control template.

The GetTextRTF code template is used to copy text to a specified string or variable. This template calls the GetText method. There are three parameters for this method. They are the string or variable to get text to, the starting position to get text from, and the ending position to get text from. This method may optionally return the length of the string read. If the method parameters are not used, the current cursor position or selected text is used.

Prototype:

GetText( text, [StartPos], [EndPos] )

Return Data Type: LONG

Example method calls:

oRTF_RTFTextBox.GetText( loc:find, , ) !read text into loc:find

loc:length = oRTF_RTFTextBox.GetText( loc:find, , ) !return string length

oRTF_RTFTextBox.GetText( loc:find, 10, 20) !read text into loc:find from

!specified position

Template Prompts:

Associated RTF control

Select the RTF control from the drop-down list. All controls on the Window are included in the list. This field in required.

String to Receive Text

Specify a string or variable that will receive the specified text. The highlighted text will be assigned to the variable if no starting and ending positions are specified. If positions are specified the text specified by these positions will be assigned to the string variable.

Starting Position or variable (prefixed with !)

Specify the starting character position to copy text from. A variable may be used. To use a variable, precede it with an exclamation point (!).

Ending Position or variable (prefixed with !)

Specify the ending character position to copy text from. A variable may be used. To use a variable, precede it with an exclamation point (!).

Variable to receive string length

Specify a variable to hold the length of the string.

gettextrtf_code_template.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1