Results 1 to 3 of 3

Thread: Need a speedier replacement

  1. #1

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    Need a speedier replacement

    I was working on some code i found a while back which will take HTML keywords and highlight them in Delphi. The problem is, the process takes far too long, i was hoping for the speed similiar to which Frontpage colours at.

    If you look at the code here: http://www.vbforums.com/showthread.php?t=346505

    I would appreciate if anybody knew a way to edit this code to process the coluring much faster, or better still, if anybody knew a replacement code?

    Thanks in advanced

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Need a speedier replacement

    The best way to speed it up would be to change it to find the start and end markers (using an equivalent of VB's InStr, if available) and colour the whole block that needs to be coloured, rather than reading every character and colouring them individually.

    Once you have your start and end markers you can do your Dop check within that range (in the same style).


    Also, you may find it faster to store the text into a variable rather than read from the RichEdit every time.

  3. #3

    Thread Starter
    Supreme User Madboy's Avatar
    Join Date
    Oct 2003
    Location
    England
    Posts
    3,253

    Re: Need a speedier replacement

    Thanks Si, i will look into that

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