Solved

Question for: TheRealLoki

Posted on 2006-07-13
2
249 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
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 30

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now