I have a problem with setting a range on a secondary index in a Paradox 7 table using Delphi2010.
The relevant fields are:
FeatureType (int); YMax (int); XMax (int); YMin (int); Xmin (int). The secondary index contains all these fields in this order.
I tested using a SetRange statement like so (not necessary to add all field values, rest is assumed NULL and all values are included):
table1.IndexName := 'YMaxIndex';
table1.SetRange([101, 280110400],[101, 285103294]); //386236 records
And tried to get a 0 result by adding to the constraints:
table1.IndexName := 'YMaxIndex';
table1.SetRange([101, 280110400, 1],[101, 285103294, 1]); //386236 records
But still gets 3863236, which is clearly incorrect when checking the values in the XMax field in the table.
Can someone please explain to me what I am not understanding about Paradox index and SetRange? I have used similar code frequently but not necessarily with 3 fields specifying the range.
Update
See Uwe's response below. The final code solution follows (new ranges for XMax):
Table1.SetRange([101,280110400], [101,285103294]);
Table1.Filter := 'XMax > 100000 and XMax < 110000';
Table1.Filtered := true;