Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Ink
Newbie


Joined: 23 Jun 2007
Posts: 2

PostPosted: Sat Jun 23, 2007 5:31 pm   

[1.33] %query with mutliple conditions
 
I've tried to make a db query that seeks records based on two conditions (two columns). The script could not be compiled due to extra parenthesis.

I then used the very example provided in the CMUD manual.

Code:
#SHOW %query(((&Hit>2)&&(&Dam>2)),Weapons)


Still, the compiler response is:

Code:
Error compiling script:
  extra ) parenthesis


When I leave only one condition:

Code:
#SHOW %query(((&Dam>2)),Weapons)


the script compiles just fine.

So, what is the way to provide two conditions to the query and be able to compile it?
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sat Jun 23, 2007 5:42 pm   
 
Try this
Code:
#SHOW %query((&Hit>2 && &Dam>2),Weapons)

_________________
Asati di tempari!
Reply with quote
Ink
Newbie


Joined: 23 Jun 2007
Posts: 2

PostPosted: Sat Jun 23, 2007 8:43 pm   
 
It does work this way, thank you very much.
Still the example in the manual does not. :)
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Jun 24, 2007 1:28 am   
 
That's because the change is the parser and scripting for CMUD. The database component has not been rewritten to accommodate all the new features and syntax of CMUD. That's a significant rewrite that will happen later in the year.
_________________
Asati di tempari!
Reply with quote
Dharkael
Enchanter


Joined: 05 Mar 2003
Posts: 593
Location: Canada

PostPosted: Mon Jun 25, 2007 5:33 am   
 
You could also just enclose your original query string in quotes, like:
Code:
#SHOW %query("((&Hit>2)&&(&Dam>2))",Weapons)
_________________
-Dharkael-
"No matter how subtle the wizard, a knife between the shoulder blades will seriously cramp his style."
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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