Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index Problems
Message
 
 
To
05/11/2000 21:36:03
Raymond Humphrys
Michigan Department of Community Health
Bath, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00438192
Message ID:
00438198
Views:
22
Hi Raymond,

Suppose, you have FirstName Character 15 and LastName Character 25. You want to find your name:
index expression FullName upper(FirstName+LastName)
lcSearchName=upper(padr('Raymond,15)+padr(Humphrys,25))
if seek(lcSearchName,'Employees', 'FullName')
  =messagebox("Hooray! You're an employee!")
else
  =messagebox("Sorry... You're hired")
endif
If you use alltrim, you will have an index or various length...
Try to see Help on Indexes...

>Why? What if the fields are different lengths?
>
>>>While building some compound indexes like the following ALLTR(A)+Alltr(B) name mytag, I found that I can not relate two tables together on the compound index. The table joins together just fine using the two indexes individually, but not when I concatenate them together. I went so far as to copy the concatenated values from one table to the next, reindexed and still the tables will not relate together correctly when the values are concatenated and a relation is set with the compound value.
>>>
>>>Anyone have a clue what I'm doing wrong?
>>>
>>
>>In general, it's not a good idea to use Alltrim function in compound indexes. Use A+B or upper(A+B) as index expression, where A & B character fields.
>>>thanks
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform