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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
gmueller
Apprentice


Joined: 06 Apr 2004
Posts: 173

PostPosted: Sun Jan 14, 2007 6:48 am   

mapper question
 
when I enter a room I set roomname to the name of the room

on ocassion I need to find all the rooms with the same name so I use:

#ALIAS lost {
#var replacename %replace( @roomname, ', '')
replacename = %replace( @replacename, ., '')
#MAPQUERY {NAME LIKE '@replacename%'}
}

this wont check map room names like this:

Dirt road. (road).

presumably because of the parentheis.
How do I modify the query so that it will?
Reply with quote
gamma_ray
Magician


Joined: 17 Apr 2005
Posts: 496

PostPosted: Sun Jan 14, 2007 11:59 pm   
 
If you haven't removed periods from room names in your map (and apostraphes, more about that later) then that is the problem. When you run it through the replaces, you get something like:

%Dirt road (road)%

(note complete lack of a period between the main title and the (road) suffix) where % is a wildcard, but this does not match because there is no wild card where the middle period should be. I'm not sure why you're removing periods from your search string anyway, SQL should be perfectly happy with periods in the query, and I would recommend skipping the second %replace and leaving them in which should solve this problem.

(I also recommend removing (road). from your IRE maps anyway, but that's just me.)

The other problem which you will have soon is that you need to quote the apostraphes in your query, not remove them entirely. Try

#var replacename %replace( @roomname, "'", "''")

instead!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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