|
Bluebear Beginner
Joined: 10 Oct 2007 Posts: 17
|
Posted: 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 |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: 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))}} |
|
|
|
Bluebear Beginner
Joined: 10 Oct 2007 Posts: 17
|
Posted: Mon Jan 21, 2008 8:09 am |
Many thanks.
|
|
|
|
|
|