Welcome! Log In Create A New Profile

Advanced

HFilter - FOUND IT!

Posted by David Egan 
David Egan
HFilter - FOUND IT!
January 21, 2009 12:53AM
Hi
I normally use SQL so am used to filtering records based for example on RED appearing anywhere in a description field using LIKE '%RED%'. I need to do the same type of thing in a HF database using HFilter but can't find how to do it. Is this possible with HFilter? I was hoping there'd be some sort of an operator that would handle this. I know I can do this with a query but for this particular purpose I'd prefer to just use HFilter.

Thanks

David



Edited 1 time(s). Last edit at 01/21/2009 12:59AM by David Egan.
Stefan Bentvelsen
Re: HFilter - FOUND IT!
January 21, 2009 08:58AM
Hi David,

you can use the selection condition of the HFilter statement (see helpfile HFilter, Notes).
With "YourItem]RED" you can do a case sensitive search for RED, with "YourItem~]RED" a non case sensitive search.
Jaime Fernandez
Re: HFilter - FOUND IT!
January 21, 2009 09:56AM
Hi,
I'm trying something like that but with characters: Like 'F?i*' in order to obtain all names starting with: first character: F, second: any, third:i, fourth:0 to any.

I have a Table TABLE_QRY_Names(File with direct access, Browsed file QRY_Names)
QRY_Names:
Select Name from Names (no condition)

Then, On click of a button:
I can't use HFilter because it's a automatic browsed query so I use TableEnableFilter(TABLE_QRY_Names.Name,filterStartWith,"F_i"), but obviously doesn't work because it's a literal value.

Any idea, suggestion?

Regards

Stefan Bentvelsen
Re: HFilter - FOUND IT!
January 21, 2009 12:24PM
Hi,

as far as I know, you cannot use wildcards this way. I don't know a way to make this possible with HFilter.
Jaime Fernandez
Re: HFilter - FOUND IT!
January 21, 2009 06:32PM
Thank you Stefan, so only via sql it is possible.
Regards
Piet van Zanten
Re: HFilter - FOUND IT!
January 21, 2009 07:54PM
Or by plain programming.
sItemList=hlistitem(MyFile)
bFound=False
FOR ALL xxxx
     for each string sItem of sItemList separated by CR
            if Position(lower({sItem,indItem},lower(sSearch)) then
            bFound=True
            break
     end
     if bFound then //add to  table
END
(code not tested)

Regards,
Piet
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: