There is a limit (I don't remember exactly how many chars). There are three solutions (the third I think is the best...)
1. Build the filter in the form A|C..K|Z.
2. Use MARK.
3. Use a temporary table to store the records you want. Then an
IF TempRec.GET(KeyValue) THEN BEGIN
END;
is like a filter...
I believe the maximum filter string length is 250 characters. The issue of over flowing filterstring happens a lot when it is built in code like that. You'll need to program a check to make sure it doesn't go over.
for i := 1 to 1024 do begin
if Strlen(Filtercode) = 0 then
Filtercode := format(i)
else begin
if strlen(Filtercode + '|' + format(i)) <= 440 then
Filtercode := Filtercode + '|' + format(i);
end;
end;
message(format(strlen(Filtercode)));
Item.setfilter("No.",Filtercode);
Form.runmodal(0,Item);
So build a filter string, one character at a time, and set it as the filter. When it errors out, you will know the answer.
By the way, 440 does not sound right to me. I remember getting errors as soon as the length hits 250. It might have changed though. One way to find out: test it.
With the test code snippes above, the filterstring on Item no is >250. It's 439.
Maybe the problem in older versions was the Variable lenght of 250.
Now it's max 1024.
Also possible, that MS has changed the max. Filtercriteria parameter.
Answers
1. Build the filter in the form A|C..K|Z.
2. Use MARK.
3. Use a temporary table to store the records you want. Then an
IF TempRec.GET(KeyValue) THEN BEGIN
END;
is like a filter...
RIS Plus, LLC
Regards
Perhaps 250 chars are guarantied to work and larger filters may work under special circumstances.
It would be good to know the exact maximum number of characters guarantied to work and even better to know why.
By the way, 440 does not sound right to me. I remember getting errors as soon as the length hits 250. It might have changed though. One way to find out: test it.
RIS Plus, LLC
Maybe the problem in older versions was the Variable lenght of 250.
Now it's max 1024.
Also possible, that MS has changed the max. Filtercriteria parameter.
regards
Thank you all for your help. I'll stay under 250 chars and I'll be ok.