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
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Thu Jun 15, 2006 10:12 pm   

find function replacement
 
I have a replacement find function I've created. At the heart of it is getting a list of possible rooms and then paring that down by elimination based on exit information. Most of the time it works fine, it malfunctions if there is an apostraphy "'" in the name when I call the following function:

#var possibleRooms %mapquery( {[Name] = '@roomName'})

The variable @roomName contains the name of the room and could contain an "'" such as "Mom's Kitchen". Is there a way I can overcome this limitation by escape characters or some other syntax?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Jun 15, 2006 11:08 pm   
 
Try using %quote(). Apostrophes are moreorless single-quotes, though, so it might still mess up.
_________________
EDIT: I didn't like my old signature
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Thu Jun 15, 2006 11:41 pm   
 
So how would one lookup a room with a single quote in it in theory?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Fri Jun 16, 2006 9:14 am   
 
Most implementations of SQL use 2 single quotes to escape one.
#var possibleRooms %mapquery( {[Name] = '%replace(@roomName,"'","''")'})
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
ReedN
Wizard


Joined: 04 Jan 2006
Posts: 1279
Location: Portland, Oregon

PostPosted: Fri Jun 16, 2006 3:53 pm   
 
I love you Vijilante, you're my hero. That worked perfectly!
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