Solved

Question for: TheRealLoki

Posted on 2006-07-13
2
246 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+'&#38;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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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

10 Experts available now in Live!

Get 1:1 Help Now