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
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Wed Aug 01, 2012 8:39 pm   

using %mapquery and %replace not working
 
Well, what I am trying to do is use %replace in an alias that looks up room names in my maps. What I currently have is:

Code:
%mapquery( "[Name] = '%replace(%-1, "'", "''")'")


However, this isn't working at all. From what I can tell inside zMud, the %replace isn't activating. I've been playing with it for 1 1/2 hrs now and I'm not sure how to fix it. Any help would be appreciated.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Wed Aug 01, 2012 8:44 pm   
 
The %replace isn't activating cause you have it in a string (within quotes), so it's being treated as a literal. You'd need to do something like this:
Code:
%mapquery( "[Name] = '"%replace(%-1, "'", "''")"'")
Reply with quote
Einder
Novice


Joined: 03 Jan 2008
Posts: 48

PostPosted: Wed Aug 01, 2012 9:23 pm   
 
What you suggested:

Code:
%mapquery( "[Name] = '"%replace(%-1, "'", "''")"'")


Was returning that the room didn't exist in the database. However, it did activate the %replace.

What I ended up doing instead, and is currently working was:

Code:
%mapquery( NAME = '%replace(%-1, "'", "''")')


Thanks for your help, it showed me the problem which is what I needed :).
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