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


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Oct 22, 2004 2:06 pm   

Correct way to double up chars?
 
Ok not sure how to explain this but but is there a better way to write this so it works without forcing expansion <> or using %char(37) in place of the % wildcard for the search.

%mapquery([NAME] LIKE '%%replace( %-1, "'", "''")%'}) //doesn't work
%mapquery([NAME] LIKE '~%%replace( %-1, "'", "''")~%'}) //doesn't work
%mapquery([NAME] LIKE '%quote(%)%replace( %-1, "'", "''")%quote(%)'})
%mapquery([NAME] LIKE '%<%replace( %-1, "'", "''")>%'}) //works but I don't want to force expansion
%mapquery([NAME] LIKE '%char(37)%replace( %-1, "'", "''")%char(37)'}) //Works but I don't want my code to get all cryptic

Im thinking the last option is prolly the only way to go....... but if there is an easier way it sure would help to know :P
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Oct 22, 2004 9:29 pm   
 
Off the top of my head:
%mapquery([NAME] LIKE '%{%replace( %-1, "'", "''")}%'})
%mapquery([NAME] LIKE '~%{%replace( %-1, "'", "''")}~%'})
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Fri Oct 22, 2004 10:40 pm   
 
Vijilante your last one works but gives a syntax error and since I hate those when Im trying to write a script it looks like Im stuck using the %char() method
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Vodoc
Apprentice


Joined: 11 Apr 2003
Posts: 119
Location: Sweden

PostPosted: Sat Oct 23, 2004 1:28 pm   
 
%mapquery( %concat( "[Name] LIKE '%", %replace( %-1, "'", "''"), "%'"))

Should work...
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