<br><font size=2 face="sans-serif">Sorry for the off topic...</font>
<br>
<br><font size=2 face="sans-serif">I have a text-mode file viewer that I wrote for Win32 and Go32. I'm trying to add a new feature; syntax highlighting. I think it would be fairly unique to have a viewer that understands a languages syntax (I know any editor of even reasonable power has done this for years -- which I find to be totally indispensable now -- but I thought I could derive a similar benefit from a viewer that had the same ability).</font>
<br>
<br><font size=2 face="sans-serif">Every implementation that I've coded thus far has either had some type of rendering problem and/or been horribly slow. The one I thought would have the most promise was loading a bunch of keywords in memory and then scanning each line of the display everytime a movement command (pgup/pgdn/arrows etc) was issued for words that matched the ones loaded in memory. But unfortunately pos() has proven to be way too slow for this, seeing as how the list of potential words to be highlighted could be a few hundred, so when I run the program on anything less then a screaming-fast PC it redraws the screen terribly slow and uneven. Sigh...</font>
<br>
<br><font size=2 face="sans-serif">I've looked at shedit in the FCL, but I'm afraid I don't understand objects enough to be able to make much sense of the syntax highlighting code in their. So, my question is this; does anyone know of another method for syntax highlighting other then using pos() on each line? Is there a way to make pos() faster? Is there something better then pos() to check if a string resides within another string?</font>
<br>
<br><font size=2 face="sans-serif">Any concepts on how to do this -- or even better, some example code -- would be greatly appreciated. TIA...</font>
<br>
<br><font size=2 face="sans-serif">Jim</font>