Sorting compound names

Francois Van Lerberghe fvanlerberghe at freegates.be
Sun Sep 19 10:00:20 CDT 2004


le 18/09/04 21:31, Ruslan Zasukhin <sunshine at public.kherson.ua> a écrit :

>>> What about this:
>>> 
>>> You make 2 fields:
>>> 
>>>     prefix
>>>     LastName
>>> 
>>> 
>>> If syrname is
>>> 
>>>     von Something
>>> 
>>> You split it in 2 fields.
>>> If there is no name then prefix is empty.
>>> 
>>> So when you show to user you build string using 2 fields.
>>> 
>>> And you use the second filed to sort.
>>> 
>>> In case exists also suffixes, then you create third field.
>>> 
>> 
>> Hm, interesting. But in my case the names are not in individual
>> fields, but listed in one field (separated by returns).
>> 
>> What about this -- can this be done in 2.x?
>> 
>> 1. Get a cursor.
>> 2. Find/replace every occurrence of a "forbidden" word (list provided
>> by the user) in the name field (e.g. find "von " and replace with "").
>> 3. Sort the cursor by that field...
>> 
>> Or is this something that can/should be done with temporary tables?
> 
> Only tmp table
> 
> I still believe that if you have some data that must be proceed in separate
> way, you must extract them into separate column

You could use a virtual field (with a method) that do the replace/split.
Then you do the sort on that field.

François Van Lerberghe
Rue Thier Monty, 15 A
4570 Marchin
Belgique



More information about the Valentina-beta mailing list