Hi Neven,
 
I see you are very keen to improve your code performance from your two questions. Here is the link may help you.  http://www.optimalcode.com/.
 
Cheers
Leigh
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Neven MacEwan
Sent: Friday, November 01, 2002 12:28 AM
To: Multiple recipients of list delphi
Subject: [DUG]: Friday Challange

Hi all,
 
Further to my enpty string question, I'm writing a lot of
functions that return a set of strings joined by a separator
ie 'col1, col2,...' or 'col1 = 'a' and colb = 'b'' (as you may guess
these are all parts of SQL Statements)
 
given a function 'Itemcount' that returns the number of items
and item(i) that returns the item string, and function sep what is the
best form of such a function
 
to seed the duscussion I'll give you one of my variants
 
function statement: string;
var
  I: integer;
begin
  Result := '';
  for I := 0 to pred(ItemCount) do
    if I = 0 then Result := Item(I)
    else Result := format('%s%s%s',[Result,Sep,Item(I)])
end;
 
Variants and explainations pls
 
Neven
 

Reply via email to