Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nice order to create
Message
From
18/03/2016 05:31:21
 
 
To
18/03/2016 05:16:34
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01633318
Message ID:
01633323
Views:
68
the ordering of "03" needs converting via value, ordering "AA" after "B" might imply converting via Hex or at least a padl(), but then you will give me an item with a letter beyond "F" like "R" in first spot or n- letter groups ? Can you define the ordering algorithm in words?

//upd: if you can define a max length between dots, a max # of dots (arbitrarily high would be enough) and can exclude all chars not in ["0".."9"] or ["A".."Z"]
you could build an ordering string of padl() columns, see example down below in your ordered data, with comment on "03", column max length of 4 ;-))

>The number of dots is not limited, at least not reasonable. :(
>Also the user might alter the field (IOW append dot letter sections or change the whole thing). Thats why I like to have it as index expression - it would sort itself.
>
>>create 3 virtual columns with the dot as separator, order columns on padl(evl(int(val()), 999),3). Then think about the last Item, AA ;-)
>>
>>
>>
>>>Hi everybody.
>>>
>>>I have a list with elements like
>>>
>>>1
>>>10
>>>2
>>>03
>>>1.1
>>>12.R
>>>1.1.R
>>>1.R
>>>1.R.1
>>>A
>>>B
>>>AA
>>>5.R
>>>
>>>I need to order (by indexing) this to
>>>
>>>    1
>>>    1.    1
>>>    1.    1.    R
>>>    1.    R
>>>    1.    R.    1
>>>    2
>>>   03        && here you need a padl(int(val())) to be ordered above next item! Or at least padding with "0"
>>>    5.     R
>>>   10
>>>   12.     R
>>>     A
>>>     B
>>>  AA
>>> 0001
>>> 0001.0001
>>> 0001.0001.000R
>>> 0001.000R
>>> 0001.000R.0001
>>> 0002
>>> 0003        && here you need a padl(int(val())) to be ordered above next item! Or at least padding with "0"
>>> 0005.000R
>>> 0010
>>> 0012.000R
>>> 000A
>>> 000B
>>> 00AA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform