Yesterday I was in a hotel with my family for a 2 day vacation, so I was bored with no net access or games and all I had was the laptop. I got kinda bored so I decided to try out some VB6 experimenting, and came up with a basic syntax highlighter just before we left. Well, it works well and I was kinda proud of it because I didn't have to do it in C or something, but the gist of how it works is it takes the text from a rich text box and parses it for keywords, so it can apply some formatting to keywords and iron out the RTF specific keywords/escape characters or whatever like braces, and convert vbNewLine to "\par " and so on. Then after the formatting I replace the TextRTF of the RTB with the formatted one that was just made, so it shows up nicely with the formatting etc. The problem is that it has to re-parse the entire text everytime the text is changed, so when I did some maniacal copy+pasting until I had 9000+ characters, the app lagged badly every time I changed the text.
Does anybody have suggestions on how to speed up the app? I'm sure this just has to do with the parsing but I don't really know what changes should be made to it.