We help IT Professionals succeed at work.

Table filter

janozzy
janozzy asked
on
HI all
I have a table.filter problem:

example:

var laskuri:integer;

for laskuri:=1 to 300 do
begin
paikatform.table1.filter:='paikat =''Paikka ''+inttostr(laskuri)';//this line not working
...
..
...
end;

How i change that line ?

Thanks all

JAnozzy
Comment
Watch Question

Commented:
Try it like this:

paikatform.table1.filter:= 'paikat = ' #39 + 'Paikka' +  inttostr(laskuri) + #39;

This would yield:
paikat = 'Paikka1'

What you'll also want is something like:

for laskuri:=1 to 300 do
begin
 paikatform.table1.filtered := false;
 paikatform.table1.filter:= '';
 paikatform.table1.filter:= 'paikat = ' #39 + 'Paikka' +
 inttostr(laskuri) + #39;
 paikatform.table1.filtered := True;
 DO WHAT EVER CODE;
end;

: )


Commented:
Try it like this:

paikatform.table1.filter:= 'paikat = ' #39 + 'Paikka' +  inttostr(laskuri) + #39;

This would yield:
paikat = 'Paikka1'

What you'll also want is something like:

for laskuri:=1 to 300 do
begin
 paikatform.table1.filtered := false;
 paikatform.table1.filter:= '';
 paikatform.table1.filter:= 'paikat = ' #39 + 'Paikka' +
 inttostr(laskuri) + #39;
 paikatform.table1.filtered := True;
 DO WHAT EVER CODE;
end;

: )


Commented:
OOPS, miised a +,

paikatform.table1.filter:= 'paikat = ' + #39 + 'Paikka' +  (inttostr(laskuri)) + #39;

Try this one instead, lol

CERTIFIED EXPERT
Top Expert 2004
Commented:
or

paikatform.table1.filter:= 'paikat = ' + quotedstr('Paikka ' +  (inttostr(laskuri)));

meikl ;-)

Author

Commented:
thanks meikl and others

Short and workin line thanks:)

Commented:
Ain't that a bitch.....Kretzs, you SUCK...lol

Explore More ContentExplore courses, solutions, and other research materials related to this topic.