Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Filter text string
Message
From
08/04/2003 05:47:48
 
 
To
07/04/2003 09:32:53
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00774644
Message ID:
00775022
Views:
18
Hi Russell

my answer is approximate.

The best solution is (especially for it lists much long):

SET EXACT ON
lcTestString='test;test;test1;test;test1;test2'
lcNewString=''
IF ALINES(aWords,m.lcTestString,";")>0
ASORT(aWords)
FOR i=ALEN(aWords) TO 1 STEP -1
i=ASCAN(aWords,aWords[m.i])
lcNewString=m.lcNewString+","+aWords[m.i]
ENDFOR
ENDIF
lcNewString=SUBSTR(m.lcNewString,2)
? lcNewString
* result words is in descending order

SET EXACT ON
lcTestString='test;test;test1;test;test1;test2'
lcNewString=''
IF ALINES(aWords,m.lcTestString,";")>0
ASORT(aWords,1,-1,1)
FOR i=ALEN(aWords) TO 1 STEP -1
i=ASCAN(aWords,aWords[m.i])
lcNewString=m.lcNewString+","+aWords[m.i]
ENDFOR
ENDIF
lcNewString=SUBSTR(m.lcNewString,2)
? lcNewString
* result words is in ascending order

Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform