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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: 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?
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: 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
Reply with quote
masterkrueger
Wanderer


Joined: 24 Jan 2010
Posts: 65
Location: Hamburg

PostPosted: 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 ^^
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: 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}
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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