Case problem
Moderator: Rathinagiri
Case problem
I have this line of code:
@ 350,250 Textbox Seek1 ;
PARENT Library_1 ;
WIDTH 200
followed soon after by:
SET ORDER TO 1
SEEK Library_1.Seek1.value
The problem is, the result is "not found" because the FIELD is in upper case and the search text is in lower case. I've been trying to think around using UPPER(...) but I don't think this solves my problem. Irrespective of case, if the text matches, I need it to be FOUND.
How have others dealt with this?
Regards,
Alan
@ 350,250 Textbox Seek1 ;
PARENT Library_1 ;
WIDTH 200
followed soon after by:
SET ORDER TO 1
SEEK Library_1.Seek1.value
The problem is, the result is "not found" because the FIELD is in upper case and the search text is in lower case. I've been trying to think around using UPPER(...) but I don't think this solves my problem. Irrespective of case, if the text matches, I need it to be FOUND.
How have others dealt with this?
Regards,
Alan
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: Case problem
Hi Alan
Does your <searchValue> and <keyValue> of index expression has equal length (including spaces) ?
You may need something like this:
Code: Select all
nKeyLen := <length_of_ İndex_expression>
SearchValue := UPPER( LEFT( ALLTRIM( Library_1.Seek1.value ), nKeyLen ))
SEEK SearchValue
Happy HMG'ing
Viva INTERNATIONAL HMG
Re: Case problem
If I specify UPPER in my search value, will that successfully find a record that is not all uppercase?
Re: Case problem
The thing is, I have a record that has been entered in all uppercase. When I search using lower case it is not found. When I search using uppercase it is found. But I need to conduct a search that ignores case.
Alan
Alan
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Case problem
You have many solutions, one is using uppercase for input and index, something like
index on UPPER(TITLE) to ITITLE
@ 130, 520 TEXTBOX mSEARCH WIDTH 100 UPPERCASE
Better way is attach your program and data
index on UPPER(TITLE) to ITITLE
@ 130, 520 TEXTBOX mSEARCH WIDTH 100 UPPERCASE
Better way is attach your program and data
Re: Case problem
I realise it's hard to understand a program when you don't have the source, but in the Windows environment, shouldn't a search (SEEK) work irrepsective of case?
Re: Case problem
Recuerda,
Clipper = Harbour
HMG es una biblioteca para crear una interfase Gráfica
Como lo hacias en Clipper ? Es lo mismo en Harbour.
-------------------------------------------------------------------
Remember,
Clipper = Harbour
HMG is a library to create a graphical interface
How did you do it in Clipper? It's the same in Harbour.
Clipper = Harbour
HMG es una biblioteca para crear una interfase Gráfica
Como lo hacias en Clipper ? Es lo mismo en Harbour.
-------------------------------------------------------------------
Remember,
Clipper = Harbour
HMG is a library to create a graphical interface
How did you do it in Clipper? It's the same in Harbour.
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: Case problem
First can you make your textbox uppercase . I am not sure with this type of entry.
I found hmg will not work with upper(textbox). This works for me. I create a local variable msearch
msearch := textbox.value
seek upper(msearch)
If eof() .or. len(alltrim(YOUR INDEX SEARCH) <> len(alltrim(msearch))
'NOT FOUND'
endif
Franco
I found hmg will not work with upper(textbox). This works for me. I create a local variable msearch
msearch := textbox.value
seek upper(msearch)
If eof() .or. len(alltrim(YOUR INDEX SEARCH) <> len(alltrim(msearch))
'NOT FOUND'
endif
Franco
All The Best,
Franco
Canada
Franco
Canada
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Case problem
I do not know what kind clipper programs you made, but if you're trying to make a windows program now, then the concept is a bit different
On the screen are objects, one is in focus, but it is easily changed by mouse click and therefore you have to predict what will happen when you do something with that object-control
All objects are "live" and something happens when you touch them and programing action
In the attach of a message is a program that searches in a slightly different way, just as a display of possibilities
On the screen are objects, one is in focus, but it is easily changed by mouse click and therefore you have to predict what will happen when you do something with that object-control
All objects are "live" and something happens when you touch them and programing action
In the attach of a message is a program that searches in a slightly different way, just as a display of possibilities
- Attachments
-
- search.zip
- (2.57 KiB) Downloaded 181 times
Re: Case problem
Try to search with softseek, in another case you must have variables with the same length