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
Malaphus
Novice


Joined: 11 Aug 2003
Posts: 34
Location: USA

PostPosted: Sun Aug 17, 2003 6:20 am   

Problem with item database triggers *NEW QUESTION*
 
OK, I found out the problem... the only thing wrong now is that it is still adding duplicate records... this is my current IF statement, but i don't think its working because the %find function i think only works for string lists, not db vars (which is what @newrecord is)... How would I fix this?:

#VAR itemDoesExist %find( %item( @newrecord, 1), All)
#IF (@itemDoesExist = "") {
#WIN Chat Item does not exist, adding!
#WIN Chat @newrecord
#NEW All @newrecord
}


At the moment it seems like the itemDoesExist variable is always being ""... even if the item does exist
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Aug 17, 2003 8:45 am   
 
%item is a list function. If @newrecord is a database variable, use a database function, such as %db. Assuming the first column of your database is Name:
#VAR itemDoesExist %find( %db( @newrecord, Name), All)
#IF (@itemDoesExist = "") {
#WIN Chat Item does not exist, adding!
#WIN Chat @newrecord
#NEW All @newrecord
}
Reply with quote
Malaphus
Novice


Joined: 11 Aug 2003
Posts: 34
Location: USA

PostPosted: Sun Aug 17, 2003 8:55 am   
 
Thanks a ton LightBulb! Your help is always appreciated!
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