Hello everyone, this is another aspect of FoxPro I’m not sure on so I hoped to be enlightened again by you all
I want to write a simple program that will search a table for all occurrences of a letter and will keep going down tell you type in the full name of what’s in the table, lets say in the table there are 100's of "How To" books so you start by typing H in to a textbox and it shows everything with H then Ho and so on tell it shows just "How To" entry’s in the grid your displaying the table on. Now I found a FAQ on here that’s helped me but I’m stuck on one thing case sensitivity, I cant for the life of me work out a way to make it if someone types in h occurrences of H and h show up right now its case sensitive.
So I’d just like to ask if this can be done make the search none case sensitive?
Link :
This is the code:
SET EXACT OFF
LOCAL cFilterOld, cFilterIn
cFilterOld = ThisForm.cFilterOld
cFilterIn = KEY()
SET FILTER TO
IF LEN(ALLTRIM(This.Value)) > 0
ThisForm.cFilter = (ALLTRIM(This.Value))
IF EMPTY(cFilterOld)
SET FILTER TO ThisForm.cFilter $ &cFilterIn
ELSE
SET FILTER TO &cFilterOld .AND. ThisForm.cFilter $ &cFilterIn
ENDIF
LOCATE
ELSE
IF !EMPTY(cFilterOld)
SET FILTER TO &cFilterOld
ENDIF
ENDIF
ThisForm.Refresh()
ThisForm.Grid1.SetFocus
This.SetFocus
I want to write a simple program that will search a table for all occurrences of a letter and will keep going down tell you type in the full name of what’s in the table, lets say in the table there are 100's of "How To" books so you start by typing H in to a textbox and it shows everything with H then Ho and so on tell it shows just "How To" entry’s in the grid your displaying the table on. Now I found a FAQ on here that’s helped me but I’m stuck on one thing case sensitivity, I cant for the life of me work out a way to make it if someone types in h occurrences of H and h show up right now its case sensitive.
So I’d just like to ask if this can be done make the search none case sensitive?
Link :
This is the code:
SET EXACT OFF
LOCAL cFilterOld, cFilterIn
cFilterOld = ThisForm.cFilterOld
cFilterIn = KEY()
SET FILTER TO
IF LEN(ALLTRIM(This.Value)) > 0
ThisForm.cFilter = (ALLTRIM(This.Value))
IF EMPTY(cFilterOld)
SET FILTER TO ThisForm.cFilter $ &cFilterIn
ELSE
SET FILTER TO &cFilterOld .AND. ThisForm.cFilter $ &cFilterIn
ENDIF
LOCATE
ELSE
IF !EMPTY(cFilterOld)
SET FILTER TO &cFilterOld
ENDIF
ENDIF
ThisForm.Refresh()
ThisForm.Grid1.SetFocus
This.SetFocus