Welcome! Log In Create A New Profile

Advanced

hFilter

Posted by AadG 
hFilter
December 02, 2020 05:08PM
Hi all,

I have a strange thing with the use of hFilter. In a file of about 25.000 records I use a simple hFilter(File,Condition);tabledisplay(Table).
When I run the selection, the table gives a result of 1881 records found, but there are a few records that do not meet the Condition. I use "Direct access". When "Loaded in memory there is no problem.

It's very simple, the value of a field = 2, but several records that are shown have not the fieldvalue 2. Has anyone seen this before (bug maybe ?)

When the result is much less then 1881 with another Condition, the problem does not exist, so only with a large output.

Best regards,

Aad



Edited 2 time(s). Last edit at 12/02/2020 05:19PM by AadG.
Re: hFilter
December 02, 2020 06:01PM
Hi Aad,

I've never seen such a result without being able to explain it. I'm sure, we can find the culprit.

What's the type of the file item?
What's the resulting character string?
Could you give us the exact WLanguage text of the HFilter(...) instruction line?

strReturnValue = HFilter(...)

Kind regards,
Guenter Predl
office@windev.at
Re: hFilter
December 02, 2020 06:13PM
Hi Guenter,

Type of file item = Numeric
Resulting string = 2 ( I don't know what you mean exactly)
Searchkey = HFilter(Klachten,"vvcleunik = "+ VV.VVCLEUNIK);TableDisplay(TABLE,taInit)

I made a simple query with the editor and that works normal.
Al
Re: hFilter
December 02, 2020 06:37PM
Hello AadG

That filter syntax allows Windev to use whatever index it thinks will work best and yes it should always work but maybe try with the full filter syntax

I presume the index in file Klachten is VVCLEUNIK

SearchKey = HFilter(Klachten,VVCLEUNIK,VV.VVCLEUNIK,VV.VVCLEUNIK);TableDisplay(TABLE,taInit)


Regards
Al
Re: hFilter
December 03, 2020 09:52AM
Hi Aad,

the function HFilter(...) should return a string which tells you the index which has been used by WINDEV if you let WINDEV choose the key to be used for executing the filer operation. Like MyString = HFilter(...). After a successful filtering the variable MyString should contain the index which had been used for the filter operation. If MyString is empty then something did not work.

Al suggested that you define the index/key to be used for selection and thereby force WINDEV to choose exactly that index.

Kind regards,
Guenter Predl
office@windev.at
Re: hFilter
December 03, 2020 11:29AM
Hello gents,

I tried both your suggestions but no luck. One thing though, when I call the table I get wrong results, but when I close the screen, open it again
and call the table, it's working perfect. Yes, I use hDeactivatefilter().

Best regards,

Aad
Re: hFilter
December 04, 2020 06:47AM
Hi all,
Something similar happened to me but with a query to postgresql (native access).
The result was correct (checked with debug) and in the table it always repeated the first record in all the lines. When I put table in memory everything was solved (WD23). And no, I did not get to know the reason.
Best regards.
Re: hFilter
December 12, 2020 04:31PM
I did not solve the problem, but found a workaround. When I scroll through the table (mouse), the output is going wrong(not filtered records are shown). When I use PageUp and PageDown, the table is OK.

Best regards,

Aad
Re: hFilter
December 12, 2020 06:45PM
Sometimes it could help to delete the table control and insert a new table control.
I had some strange behaviours in the past too. Deleting and rebuildung the table control helped the most time.

Greetings
Markus
Re: hFilter
December 12, 2020 06:48PM
Hi Markus,

Good idea, but I already did that. Did not work.
Thanks for your reaction.

Regards,

Aad
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: