|
Ink Newbie
Joined: 23 Jun 2007 Posts: 2
|
Posted: 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? |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sat Jun 23, 2007 5:42 pm |
Try this
Code: |
#SHOW %query((&Hit>2 && &Dam>2),Weapons) |
|
|
_________________ Asati di tempari! |
|
|
|
Ink Newbie
Joined: 23 Jun 2007 Posts: 2
|
Posted: Sat Jun 23, 2007 8:43 pm |
It does work this way, thank you very much.
Still the example in the manual does not. :) |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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! |
|
|
|
Dharkael Enchanter
Joined: 05 Mar 2003 Posts: 593 Location: Canada
|
Posted: 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." |
|
|
|
|
|