Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: Colour coded editor? How do I make one ? RTF box?

104| Thu, 29 Nov 2007 20:48:00 GMT| paul282| Comments (6)
I'm trying to write a code editor which has colour codeing but using an RTFbox's seltext is to slow, especially opening large amounts of the code.

I'm writing the editor for viewing ASP VB script and HTML in the one viewer and I wnat to colour code but it runs like a dog with fleas when you open a large source file...

how do people normally write code editors?

Keywords & Tags: colour, coded, editor, rtf, box, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/80723/
 
«« Prev - Next »» 6 helpful answers below.
www.codeguru.com/vb has some examples which do the trick (not asp though)

crazyd | Tue, 04 Dec 2007 12:39:00 GMT |

Use InterDev :)

billgates | Tue, 04 Dec 2007 12:40:00 GMT |

I couldn't find anything at www.codeguru.com/vb but then the site ran at a crawl.

What's in interdev to help? I'm not just after a code editor to use, I want to know how you write one!

paul282 | Tue, 04 Dec 2007 12:41:00 GMT |

Should be on this page...
http://codeguru.developer.com/vb/Controls/RichEdit/index.shtml

crazyd | Tue, 04 Dec 2007 12:42:00 GMT |

Thanks for the link. The code is quite clever (using the API to update the RTFbox when the app was still frozen from the effort of conversion) but very slow. on small HTML files it takes about 10 - 15 secs on a PII 350 with 128mb ram compiled for p-pro.

with a large html file (100k) it takes about 10mins !!!!!!
it seems to get exponectially slower with larger files.

I like parts of the code though so I might spend some time with it, there looks to be a poorly written loop in it, like huge string concaternation in VB, if not done properly it can slow the pc to a crawl and still take ages.

It may be optermizable

paul282 | Tue, 04 Dec 2007 12:43:00 GMT |

I found in the module a do loop in a doo loop with code like this...

iLast = InStr(iFirst + 1, rtf.Text, ">")

' and

If Trim(Mid(rtf.Text, iFirst + 5, tmp - iFirst - 5)) = "" Then

where in a large document a search of the RTF control would be called about 500,000 times. I DIMed a string with the text in it and it sped up by about 1000 times but that was still 20secs to do a document :(

paul282 | Tue, 04 Dec 2007 12:44:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories