realbasic-nug
[Top] [All Lists]

Re: PARSING TEXT AND REMOVING PARSING TAGS

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: PARSING TEXT AND REMOVING PARSING TAGS
From: Charles Yeomans <yeomans at desuetude dot com>
Date: Thu, 30 Dec 2004 19:24:12 -0500
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <F7832DBB-5AB6-11D9-8346-000A9578809A at epicodeinteractive dot com>

On Dec 30, 2004, at 6:03 PM, beto wrote:

Hello everyone ( Sorry for posting again, but I don't seem to get it working) ,


I have the following code in a method. The code works great, but after parsing the text it leaves the parsing tags. My question, how can I remove the parsing tags without losing the style of the text.

For example I have the following text:

<u>You are the searcher</u>

<b>This text is bold.</b>
<i>anyone from Italy</i>
<u>A little Underline here</u>


My code parses the text by making bold what needs to be bold and underline what needs to be underline. My problem is removing the <b> tag and the rest of the tags. I used the replace function and passed it to an editfield. When I use this method the text looses its style. I thought of creating a styleText variable and then pass my style text to that variable. I then try to pass the style text back to the editfield thinking it would keep its style, but it did not work. I got errors.


I bet. The following should work as long as the amount of text isn't too large. First, call your code that does the formatting. Then go back and strip out the tags as follows: find a tag, then select it using SelStart and SelLength. Then set SelText = "". I think that this will preserve the styles. To speed things up and prevent some other possible unsightliness, set EditField.visible = false at the start, and set it back to true when you're finished.

Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>