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
TrEz
Newbie


Joined: 02 Aug 2006
Posts: 5

PostPosted: Sat Aug 12, 2006 7:17 am   

Apostrophe problems.
 
I have an alias temp:

#va path2 {%-1}
#if (@path2 = %null) {} {#va map_path %mapquery( {[Name] LIKE '%@path2%'})}

Works nice, though if I type something like "aa bb cc'dd ee", the variable is set to it, but no response from the mapquery. Is there a way to avoid this, if there's an apostrophe?

And second question... If I have a variable @temp, and a value of:
temp=aaa bb'bbb ccdd e

is there a way to remove the apostrophe, and all words surrounding it, in this case the other words to be removed would be "bb" and "bbb". Couldn't figure this one...

zMUD 7.21

Thank you.:)
Reply with quote
saet
Apprentice


Joined: 12 Jun 2006
Posts: 106

PostPosted: Sat Aug 12, 2006 2:57 pm   
 
#VAR path2 %replace(%-1, "'", "_")

_ is a single character wildcard in SQL

Anytime I do a query I make sure to replace all apostrophes with it.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Aug 12, 2006 3:03 pm   
 
You can also double up the apostrophes. When SQL finds two apostrophes one after the other, it treats them as a single apostrophe.
_________________
Kjata
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