|
-
Mar 23rd, 2000, 01:54 PM
#1
Thread Starter
Fanatic Member
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?
-
Mar 23rd, 2000, 02:28 PM
#2
Hyperactive Member
www.codeguru.com/vb has some examples which do the trick (not asp though)
-
Mar 23rd, 2000, 04:44 PM
#3
-
Mar 23rd, 2000, 08:43 PM
#4
Thread Starter
Fanatic Member
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!
-
Mar 23rd, 2000, 08:55 PM
#5
Hyperactive Member
-
Mar 23rd, 2000, 09:54 PM
#6
Thread Starter
Fanatic Member
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
-
Mar 23rd, 2000, 10:05 PM
#7
Thread Starter
Fanatic Member
UGLY !!!
I found in the module a do loop in a doo loop with code like this...
Code:
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 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|