>Whenever I want to search for a expression regardless of being
>capitals or not, I have to write as bellow:
>
>locate for UPPER(name) = UPPER(nm)
>locate for UPPER (city) = UPPER(Ct)
>locate for UPPER (street) = UPPER (st)
>
>I would like to avoid writting UPPER ( ) and instead of that, write something in my main.prg so that I could write as bellow:
>
>locate for name = nm
>locate for city = Ct
>locate for = BA
>
>
>May anybody suggest a function ?
Set Proc To main.prg additive
procedure flocate
Lparameters pValue, pFieldName
lPCount = PCOUNT()
Do Case
Case lPCount = 1
lFieldName = FIELD(1)
Case lPCount = 2
lFieldName = pFieldName
EndCase
Locate For Upper("&lFieldName") = Upper("&pValue")
EndProc
To call it,
Select Customer
FLocate("CUST0005")
browse
or
Select Customer
FLocate("Water", "Cust_Name")
browse
but... really need to put it as proc?! +_+
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.