Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ALLTRIM in indexes
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00138923
Message ID:
00139485
Views:
41
>>One more thing: usually there is the need to use alltrim() when concatenating several fields.
>
>I'm assuming you meant "there is no need."
>
>>>Using the "-" (minus) operator to concatenate strings moves all the blanks to the end of the string without changing the total length. Usually this is enough instead of using alltrim on a whole expression.
>
>For example, for a first and last name, you definitely don't want to use AllTrim():
>
> JAMES TIM
> JAMESON ALAN
>
>If you AllTrim(), you end up with
>
> JAMESTIM
> JAMESONALAN
>
>which won't give you the correct sort order (as we usually want it).

No, ALLTRIM() doesn't touch blanks in the middle, and sometimes it might be used if user wants to have sorting by last (w/out trailing spaces)+first name. The only thing is paying attention to SQL_SELECT Where clauses which should correspond to index expressions.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform