|
masterkrueger Wanderer
Joined: 24 Jan 2010 Posts: 65 Location: Hamburg
|
Posted: Sun May 23, 2010 8:16 pm
Searching through more databases |
Hi @all
Why is the expression,
Code: |
#if (%null(%find("Goldfish",Items) OR %find("Goldfish",Monster))) {#print found nothing} {#print found at least one item} |
true all the time? even if i look for rubbish, maybe not possible in this combination? |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun May 23, 2010 8:28 pm |
the two %find() functions are returning "" as their results. Since %null is identical to "", the %null() evaluates as true.
My guess is that you need to refine your search terms to include the column name you want to look in. It's most likely defaulting to the Num column. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
masterkrueger Wanderer
Joined: 24 Jan 2010 Posts: 65 Location: Hamburg
|
Posted: Mon May 24, 2010 1:14 pm |
But if i match each DB alone i get the right results. I tried it with two #if clauses but the weird thing is, the first print shows data from the Items db, the second #if with the Monster db shows the found data from Items too. Can it be that only the active db can be searched and it doesn't matter what you write in the %find part?
I changed the part where i tried to divide Items and Monsters listed in Rooms and all together go into one db with a Monter flag :)
In my MUD i don't get exact values from Monsters I think all i need is to know if it is a Monster ^^ |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon May 24, 2010 8:25 pm |
You have an OR between two functions which return lists, not booleans. I'm not sure you can do an OR there. How about this:
Code: |
#if (%null(%find("Goldfish",Items)) OR %null(%find("Goldfish",Monster))) {#print found nothing} {#print found at least one item}
|
|
|
|
|
|
|