Results 1 to 7 of 7

Thread: Colour coded editor? How do I make one ? RTF box?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    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?

  2. #2
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386
    www.codeguru.com/vb has some examples which do the trick (not asp though)

  3. #3
    New Member Bill Gates's Avatar
    Join Date
    Mar 2000
    Posts
    7
    Use InterDev

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    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!

  5. #5
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Rotterdam, Netherlands
    Posts
    386

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    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

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    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
  •  



Click Here to Expand Forum to Full Width