Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need idea for sort
Message
From
26/02/2010 05:23:03
 
 
To
26/02/2010 04:58:57
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01451160
Message ID:
01451169
Views:
61
>>Not enough info.
>> For example - what number does '1.10.R.1' represent?
>>1 ? 1.10 ? 110 ? 1101 ? 1.101 ? ???
>>Will the alpha part have *any* significance ?
>
>Hi Viv
>
>its not a number (that would be to easy)
>
>For further discussion:
>We will count any section separated by a point a word
>
>Imagine version info as you get with VERSION(4). This contains out of 4 words
>
>so I have to order first by the leftmost, then by the next to the right and so on
>
>Only that somebody skips the leading 0 sometimes and the number of words my change from 1 up to len()/2
>And he mix up with letters that have there own meaning.
>The number of words alters from record to record
>
>This is a code to number something.
>
>So one word means something in it's basic style,
>-two words, all digits means something inserted between one word sorts by the needs of operation
>original 1 , 2 , 3 now 1 , 2.1 , 2.2 , 3
>-two words, second word start with 'N' means means something inserted between one word sorts by the needs of design
>original 1 , 2 , 3 now 1 , 2 , 2.N , 3
>-two words, second word start with 'R' means means something inserted between one word sorts by the needs of repair
>original 1 , 2 , 3 now 1 , 2 , 2.R , 3
>
>so this goes on like
>
>-three words, second word start with 'R' means means something inserted between one word sorts by the needs of repair, but it need to be separated by needs of operation.
>original 1 , 2 , 3 now 1 , 2 , 2.R.1 , 2.R.2 , 3
>
>so I think I need to order everyword first to the numerics followed by the alphas.
>
>I can do this with some loops and sorting this with some IFs but I look for a fast and clever way.

Still not clear I'm afraid. Taking '1.10.R.1' as an example: As I understand it you break it down to 4 fields (stop is always a seperator - never a decimal point) i.e:
1
10
R
1
For sorting purposes should the items that look like numbers be treated as numbers or character strings? Is there a maximum length to any field within a record or for the number of fields that a record can contain?
eg. Could '123.345678.ABC.234' occur?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform