|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Nov 14, 2006 1:12 pm
[1.15] Sorting of a list |
Code: |
DML=%countlist( @mylist);mylist="";#FORALL @myorder {#IF (%iskey( @DML, "%i")) {#LOOP %db( @DML, "%i") {mylist=%additem( "%i", @mylist)};#DELKEY DML {%i}}};#LOOPDB @DML {#LOOP %val {mylist=%additem( %key, @mylist)}};#UNVAR BML |
the above code should sot the contents of @mylist according to the order inside @myorder
Doesnt throw up errors and doesnt crash, just doesnt work in cmud.
any ideas?? thanks |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Tue Nov 14, 2006 2:04 pm |
Try not using quotes around %i. In CMUD, this treats %i as a literal string and does not expand it. If you really need to expand it and it has multiple words, use curly brackets instead of quotes.
|
|
|
|
adamwalker Apprentice
Joined: 12 Mar 2005 Posts: 195
|
Posted: Tue Nov 14, 2006 3:41 pm |
yup. is the "%i". all works now, thankyou
Perhaps zugg could add this to the compatability editor sometime. chears zugg |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Nov 14, 2006 8:27 pm |
I'll add this to the compatibility report.
|
|
|
|
|
|