I have another idea. Since the user can type or paste anything they want into the RichEdit control, wherever in the contents that it makes sense, why not make that the method of choice?
They can copy and paste canned text into the control, at the end, in the middle, at the top, and edit it right there. You don't have to process anything, just make both the canned text control and the target control available at the same time. Dennis McGrath -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of MikeB Sent: Thursday, July 16, 2009 12:15 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: VarChar Data and RTF And now we know the rest of the story.... ----- Original Message ----- From: "MDRD" <[email protected]> To: "RBASE-L Mailing List" <[email protected]> Sent: Thursday, July 16, 2009 1:03 PM Subject: [RBASE-L] - Re: VarChar Data and RTF Paul We also type in personal notes and modify the canned text to fit each visit. Saving the notes gives a better history of what was done. Marc From: Paul InterlockInfo Sent: Thursday, July 16, 2009 11:57 AM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: VarChar Data and RTF Stupid thought here but could you not use a report to do this! On demand and figured if you wanted to review this just recreate the report again. I am questioning the need to save as one? If the user wants to review the instructions given you simply recreate the report again. Of course you could find the 'Bold' & 'Red' commands with var's and recreate them all in one form field with a lot of code and then save this as Mike B. was talking about, but I do not see the need. Just do it on the fly. (Thank you Mike B. for that insight a year ago! Re-create on the fly part. ) Just my view from my desktop & .03 Sincerely, Paul D From: [email protected] [mailto:[email protected]] On Behalf Of MDRD Sent: Thursday, July 16, 2009 12:31 PM To: RBASE-L Mailing List Subject: [RBASE-L] - Re: VarChar Data and RTF I have been doing this for years with plain text and it works Great. Then I decided it would be cool to add bold and red text to the notes and I bit off more than I can chew. My goal is to get some formatted text from a Varchar column that is stored in a lookup table such as this [Fname] was instructed to put Ice on his ankle .... Warning do not freeze your foot Do a SRPL to change [Fname] to .vFname ...and a few more SRPL's then add that to the end of the patient notes which are stored in a Varchar column. The patient notes in the Varchar field may already have Bold or red text too I believe you can SRPL plain text for plain text in a Varchar column even if it has bold and red text? At least the limited testing I did seemed to work. Thanks Marc -------------------------------------------------- From: "MikeB" <[email protected]> Sent: Thursday, July 16, 2009 9:54 AM To: "RBASE-L Mailing List" <[email protected]> Subject: [RBASE-L] - Re: VarChar Data and RTF > You have never specified the original "source" of the RTF. That's why I > listed how to join them, no matter the source. If the text that is stored > contains formatting, _including_ BOLD or FONT, then my description > applies. > If it only contains CRLF, then it is plain text. If the data isn't > sensitive, why don't you show two sources you are trying to combine so we > can go from there? > > ----- Original Message ----- > From: "MDRD" <[email protected]> > To: "RBASE-L Mailing List" <[email protected]> > Sent: Thursday, July 16, 2009 9:01 AM > Subject: [RBASE-L] - Re: VarChar Data and RTF > > >> Mike >> >> I hope I do not have everyone mixed up on what I am trying to do? >> You may know this already but I am trying to combine 2 Varchar >> columns with formatted data. I am not really joining files. My code >> sets the lookup Varchar data to a Variable then Updates the other Table. >> >> It seems that Varchar variables only hold raw text and can not hold Bold >> or red text >> without converting it to the formatting gibberish and that gibberish >> breaks the Update >> command. >> >> Thanks for all the help >> Marc >> >> >> >> >> -------------------------------------------------- >> From: "MikeB" <[email protected]> >> Sent: Wednesday, July 15, 2009 5:51 PM >> To: "RBASE-L Mailing List" <[email protected]> >> Subject: [RBASE-L] - VarChar Data and RTF >> >>> Marc, >>> >>> Now that I've refreshed my memory a bit on RTF, it seems like there is >>> likely an all RBase way of concatenating RTF with at least a couple of >>> major hurdles. Now it is true this could be an all RBase solution, but >>> as you will read below, it could become cumbersome to the point that it >>> should be done in a DLL for speeds sake. >>> >>> One biggie would be that the originating RTF isn't from a recent >>> version >>> of Word. I looked at the difference in the RTF from WordPad and the >>> same >>> document saved in Word and word has over a hundred lines of crap after >>> the "legal RTF" document description that relates to the Theme (meta) >>> data from Word. >>> >>> The second, is you have to be prepared to programatically manipulate the >>> Font Table. The font table "{\fonttbl" is created with the documents >>> default font as "\f0" and with the first change after that "\f1" and so >>> on in that fashion, so if the merged document has the same fonts, but >>> were created in a different order, the lookup for the font to apply for >>> the text in the font table will display an incorrect font, so merged RTF >>> has to have any disparate (non existing) font added to the base >>> document's Font Table, and the sequencing of the font markup changed to >>> match the order of the Font Table >>> >>> Now for the structure of the RTF. >>> >>> It appears that when there is a complete "file" or document >>> description, >>> the document header line ends in a CRLF, so to determine if the VarChar >>> data is just a snippet or a complete document, you need to test for the >>> presence of expected text in the header, the most obvious is the first 5 >>> characters of the file "{\rtf", with the 6th character being the version >>> of the RTF (1 through 4). >>> >>> So if you test for the headers presence and it is TRUE, then to add >>> another snippet to it, we need to remove the LAST character of the file, >>> which is the last closing brace "}" , then you can concantenate your >>> snippet to it, ADD back the closing brace "}" and you have a complete >>> file. >>> >>> If you are merging TWO Files together, you would remove the header from >>> the second file (after removing the closing brace from the first) and >>> simply concantenate the remainder of the second file to the first >>> (observing what has to happen to the font table as described before). >>> >>> HTH, >>> >>> Mike >>> >>> >>> >>> >> >> > >

