Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining RTF fomatted text
Message
From
18/11/2003 00:18:41
Scott Butts
Ims Specialty Services
Twin Falls, Idaho, United States
 
 
To
17/11/2003 19:25:33
Michael Gass
Instructional Software, Inc.
Kirkland, Washington, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00850825
Message ID:
00850861
Views:
15
>How can I combine two memo fields containing RTF text in order to display them together in a RichText Control?

Here is some code cut from a working object that does just that, I haven't tested the cut up code so if you have some problems, drop me an email. Hope this helps.

First create a cursor with all the rich text information in memo fields that you want to process.
WITH THIS
	.oRTF.TextRTF 	= ""
	SCAN
		lcReturnText = ""
		lcReturnText = TableName.RTFText_From_Memo_Field
		IF !(EMPTY(lcReturnText))                             && if you have RTF to add
			.oRTF.SELSTART 	= LEN(.oRTF.TextRTF)          && start at end of current RTF
			IF !EMPTY(.oRTF.TEXT)                         && if there is text in the control
				.oRTF.SELTEXT 	= CRLF                && add a CRLF
				.oRTF.SELSTART 	= LEN(.oRTF.TextRTF)  && Reset the insertion start point
			ENDIF
			.oRTF.SELTEXT = lcReturnText                  && Add the new RTF Text
		ENDIF
	ENDSCAN
	lcReturnText = .oRTF.TextRTF
ENDWITH
RETURN lcReturnText
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform