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
|
- Re: [DUG]: Friday Challange Neven MacEwan
- Re: [DUG]: Friday Challange Dennis Chuah
- Re: [DUG]: Friday Challange Neven MacEwan
- Re: [DUG]: Friday Challange Dennis Chuah
- Re: [DUG]: Friday Challange Kurt at iadvance
- Re: [DUG]: Friday Challange peter
- Re: [DUG]: Friday Challange James Sugrue
- [DUG]: RichEdit - How can I select text fro... gajo
- [DUG]: Quicky - the registry Alistair George
- RE: [DUG]: Quicky - the registry Andreas Toth
- Re[2]: [DUG]: Quicky - the reg... Alistair George