 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: 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? |
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Thu Jun 15, 2006 11:41 pm |
So how would one lookup a room with a single quote in it in theory?
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: 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 |
|
|
 |
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Fri Jun 16, 2006 3:53 pm |
I love you Vijilante, you're my hero. That worked perfectly!
|
|
|
 |
|
|