realbasic-nug
[Top] [All Lists]

advice on methodology please

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: advice on methodology please
From: Paul Harvey <realbasic at hiddenfield dot com>
Date: Fri, 4 Jul 2003 21:14:46 +0100
I'm bumping my head against a wall here!

I want to read a text file from the disc into an editfield [no problem] but parse some basic tags. Current tags are simply <b>...</b>, <i>...</i>. There will be others later. As an example:

This is <b>some bold and <i>italic</i> text</b>

I want to style the text according to the tags, in the case above it would be Bold and Italic text, but other tags would involve a number of style modifications to the text.

The problem is how to read the file, strip the tags and set the styles in the editfield. I can go to StylData, but don't want to because of its complexity for something that doesn't seem to need it. I would rather work with SelBold, SelItalic, et al for the time being.

The main problem I have is when a pair of tags are found and the text between is styled, the tags need to be removed. Using something like ReplaceAll or RegEx strips the styling from the text.

Any ideas, however random are appreciated!

--
Paul Harvey
paul at hiddenfield dot com

Hiddenfield Software
"Creating useful software for Mac OS X"
* Bible Reader Free

www.hiddenfield.com

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