Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: 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
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: 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.
Reply with quote
adamwalker
Apprentice


Joined: 12 Mar 2005
Posts: 195

PostPosted: 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
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Nov 14, 2006 8:27 pm   
 
I'll add this to the compatibility report.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net