Hi Brandon,
thank you
Sort of,
If you add
INSERT INTO c_test (ctext) VALUES ('01.R')
INSERT INTO c_test (ctext) VALUES ('1.02.100')
INSERT INTO c_test (ctext) VALUES ('1.02.NA')
INSERT INTO c_test (ctext) VALUES ('01.R1')
INSERT INTO c_test (ctext) VALUES ('01.1R')
you see its problems. Anything starting with a digit should be basically a digit, and all words starting with alpha should come after the digit ones. (1.1 followed by 1.R)
Agnes
>Here's an ugly way
>
>CREATE CURSOR c_test (ctext C(40))
>INSERT INTO c_test (ctext) VALUES ('1.1')
>INSERT INTO c_test (ctext) VALUES ('1.02')
>INSERT INTO c_test (ctext) VALUES ('10.1')
>INSERT INTO c_test (ctext) VALUES ('01.3')
>INSERT INTO c_test (ctext) VALUES ('1.02.N')
>INSERT INTO c_test (ctext) VALUES ('1.02.N.R')
>INSERT INTO c_test (ctext) VALUES ('1.10.R')
>INSERT INTO c_test (ctext) VALUES ('1.10.R.1')
>INSERT INTO c_test (ctext) VALUES ('20DP')
>INSERT INTO c_test (ctext) VALUES ('20')
>INSERT INTO c_test (ctext) VALUES ('1.02.R')
>
>LOCAL lcSelect
>lcSelect=[SELECT ctext,]
>FOR lnX=1 TO 20
> lcSelect=lcSelect+[PADL(ALLTRIM(STR(VAL(GETWORDNUM(ctext,]+ALLTRIM(STR(lnX))+[,'.')))),40,'0')+]+;
> [PADR(CHRTRAN(GETWORDNUM(ctext,]+ALLTRIM(STR(lnX))+[,'.'),'0123456789',''),40) ]+;
> [as s]+ALLTRIM(STR(lnX))+;
> IIF(lnX<20,[,],[])
>endfor
>lcSelect=lcSelect+[ FROM c_test ORDER BY ]
>FOR lnX=1 TO 20
> lcSelect=lcSelect+[s]+ALLTRIM(STR(lnX))+IIF(lnX<20,[,],[])
>ENDFOR
>
>&lcSelect
>
>
>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]