PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV 2024 → Hfilter - problem using it multiple times on the same file
Hfilter - problem using it multiple times on the same file
Started by Norman, Aug., 29 2005 1:16 PM - 3 replies
Posted on August, 29 2005 - 1:16 PM
I have a file which has several non-unique keys. One is a date field and another a boolean value. I am using Windev 9.
I use Hfilter on two totally different browses to restrict by either the boolean value or the date. I use Hfilter/Hactivatefilter before opening the browses and then Hdeactivatefilter after.
I noticed something strange. Using a file that contains 10 records, 6 have a date of the 24th and 4 of them a date of the 25th. 5 have a true boolean value and 5 have a false value.
If I went into the filtered browse on the boolean value then it showed five records (correct) but if I went into the browse for the date filter (which gave 4 for the 25th) then came out and then went into the boolean filtered browse afterwards it only showed 4 records when it should have shown 5.
If I added this before code the boolean browse then it worked fine every time -
Hopen(Myfile)
Hreadfirst(Myfile,booleanvalue)
Hclose(Myfile)
It looks like some kind of pointer issue.
I have checked my code and I do deactivate the filter properly between browses.
Has anyone come across this before?
Norman
Posted on August, 30 2005 - 7:02 PM
I had some similar problems using HFilter on vision plus tables in windev V8.
I am using the Hyperfile DB.
I have put this aside for now as I will be moving to V9 and mysql when V9 ships.
My hope is that the problem with go away at that point.
Posted on September, 02 2005 - 5:24 PM
I had some similar problems using HFilter on vision plus tables in windev V8.
I am using the Hyperfile DB.
I have put this aside for now as I will be moving to V9 and mysql when V9 ships.
My hope is that the problem with go away at that point.

According to the manual if you declare a filter and then declare another one for the same file then it only uses the latest one, although being able to put a filter on a filter might not be such a bad thing.
I have added HClose(Myfile) after the HDeactivateFilter statement as this destroys it entirely and seems to resolve the problem.
I have already moved to 9 and have now jumped in feet first by buying Webdev 9 as well!
Norman
Posted on September, 04 2005 - 10:14 AM
Thanks, that makes sense, I'll give it a try.
I do have to say that I've had so much success with Windev so far that I am confident there will be solutions to most of these things.