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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Bluebear
Beginner


Joined: 10 Oct 2007
Posts: 17

PostPosted: Mon Jan 21, 2008 7:45 am   

How to easily strip periods from an entire database?
 
Following on from my last post regarding CMUD's apparent inability to deal with periods in the #Find command, can anybody supply some clever code that will strip all the periods from my map database?

Thanks
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon Jan 21, 2008 8:07 am   
 
Assuming no other periods (which I think is likely)

#loop %numrooms {$vnum=%roomvnum(%i);#call %roomname($vnum,%subchar(%roomname($vnum),"."))

If some of them do have periods in their names then

#loop %numrooms {$vnum=%roomvnum(%i);$roomname=%roomname($vnum);#if (%ends($roomname,".") {#call %roomname($vnum,%leftback($roomname,1))}}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Bluebear
Beginner


Joined: 10 Oct 2007
Posts: 17

PostPosted: Mon Jan 21, 2008 8:09 am   
 
Many thanks.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion 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