Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ALLTRIM in indexes
Message
From
28/09/1998 17:09:39
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00138923
Message ID:
00141630
Views:
34
>>We may put this as a rule. I've found a workaround to achieve the listing by AllTrim(first)+' '+AllTrim(second):
>>
>>index on first - (' '+second) tag whatever
>
>I think this tag would give incorrect results if either the first or last name contained spaces. For example:
>
> Van, Jim
> Van Deusen, Jim
>
>would sort as
>
> VAN DEUSEN JIM
> VAN JIM
>
>However, perhaps using a different delimiter than a space would work. I wouldn't bother, if the value is going to get padded out to the full lengths of the constituent fields anyway.

I've overseen this because we simply don't have spaces in names; even my wife, having two family names, writes them with a dash between. You're right, could be better with
index on first - (', '+second) tag whatever
But this would sort them just the opposite. Maybe
index on chrtran(first - (', '+second), ",", chr(4)) tag whatever
This should put the shorter names before the longer ones, but it would slow things down - as any other attempt of trimming would. Anyway, if it's just for sorting purposes,
index on first +second tag whatever
would simply be the best. For display purposes, then, we could combine them like in previous attempts.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform