Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Nice order to create
Message
From
31/03/2016 10:17:51
 
 
To
18/03/2016 05:00:33
Lutz Scheffler
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:
01634089
Views:
55
>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
>5.R
>10
>12.R
>A
>B
>AA
>
>any idea to do this, as fast as possible?
>
>Thanks
>
>Lutz

A start point ?
With INDEX ON a padding it is required.
TEXT TO lcx NOSHOW  
1
10
2
03
1.1
12.R
1.1.R
1201.1.RBX.250.R.1
1.R
1.R.1
A
B
AA
5.R
CDXB
ENDTEXT &&lcx 

STRTOFILE(lcx,'xyz.tmp')

CREATE CURSOR curXYZ (cField c(40))
APPEND FROM xyz.tmp DELIMITED WITH TAB

DELETE FILE xyz.tmp

SELECT cField FROM (	SELECT	SELECT	CAST(ICASE( BETWEEN(ASC(cField),ASC('0'),ASC('9')),-VAL(cField)) AS B);
							           ,	 ICASE(!BETWEEN(ASC(cField),ASC('0'),ASC('9')),LEN(cField),1000);
							           ,	CAST(ICASE(!BETWEEN(ASC(cField),ASC('0'),ASC('9')),cField) AS V(40));
							,	cField ;
							,	RECNO() PK;	&& REFERENCE TO PK SOURCE
							FROM curXYZ;
							ORDER BY 1 DESC, 2,3) X
BROWSE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform