Solved

Question for: TheRealLoki

Posted on 2006-07-13
2
253 Views
Last Modified: 2010-04-05
How would I implement your latest code (Quick Code) into the "Original Code"
That we did here?

Reason:
The original code took over 30-Minutes to process 47,000+ Lines.
Then it's wrapper, which endedded up being a total of 367,000+ lines.

OK. So, as you can tell, that it a LOT of lines.
I was thinking about your code here that you last gave to me.
If there was a way to implement it, getting rid of the:

    CID := StringReplace(Memo3.Lines[i], ' ', ' ',[rfReplaceAll]);
    Con := StringReplace(Memo2.Lines[i], ' ', ' ',[rfReplaceAll]);

And replacing it with something else. (As the   CID & Con   are being used in:)
AdvMemo1.Lines.Add(' <loc>http://somesite.com/content_by_cat3.asp?contentid='+Con+'&catid='+CID+'</loc>');

Thanks a bunch, And as I promised, I will post you a question once I know you are online.

Take Care
Wayne
0
Comment
Question by:Wayne Barron
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 17

Accepted Solution

by:
TheRealLoki earned 500 total points
ID: 17105101
var
  I : Integer;
  starttime: TDateTime;
begin
  i := 0;
  starttime := now;
  memo2.lines.beginupdate;
  memo3.lines.beginupdate;
  AdvMemo1.lines.beginupdate;
  try
    for I := 0 to Memo3.Lines.Count -1 do
    begin
      AdvMemo1.Lines.Add(' <loc>http://somesite.com/content_by_cat3.asp?contentid='+Memo2.Lines[i]+'&#38;catid='+Memo3.Lines[i]+'</loc>');
      if (i > 0) and ( (i mod 100) = 0) then
      begin // only bother checking the time every 100 lines
        if (
             ((starttime + encodetime(0, 5, 0, 0)) < now) or
             ((i mod 1000) = 0)
           ) then
        begin
          inc(timesslept);
          Label3.Caption := 'sleeping  [' + IntToStr(timesslept) + ']';
          Label3.Refresh;
          Panel1.Refresh;
          sleep(10000);
          starttime := now; // reset the timer
          Label3.Caption := 'Processing';
          Label3.Refresh;
          Panel1.Refresh;
        end;
      end;
    end;
  finally
    memo2.lines.endupdate;
    memo3.lines.endupdate;
    AdvMemo1.lines.endupdate;
  end;
end;
0
 
LVL 31

Author Comment

by:Wayne Barron
ID: 17105405
Need to add one little update to the code.

Need this

Var
timesslept: integer;
begin

Thank you once again for your help and your great coding experiance.

Wayne
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to center only a line in richedit? 4 78
Dev Express grid collapse 2 55
Slow Restore if incremental backups using RDiff.exe 4 51
Firemonkey Tcameracomponent resultion 1 47
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question