|
Einder Novice
Joined: 03 Jan 2008 Posts: 48
|
Posted: 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. |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: 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, "'", "''")"'") |
|
|
|
|
Einder Novice
Joined: 03 Jan 2008 Posts: 48
|
Posted: 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 :). |
|
|
|
|
|
|
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
|
|