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
Calculus
Newbie


Joined: 05 Apr 2004
Posts: 2
Location: USA

PostPosted: Mon Apr 05, 2004 11:42 pm   

Databasing Issue
 
I really didn't want to have to ask this here but I am at my wits end.

Trying to utilize the databasing for item storage ala the help files, and I have working parsing (Pretty sure at the very least). However, my difficulties are in making it actually write a record to the database with the information in my db variable. This is the code I have for doing this.
Code:

#TRIGGER {$} {
  #T- identify
  #IF (%find( %db( @Item, Name), All|eq)) {#VAR NewItem 0} {#VAR NewItem 1}
  #IF (!%null( NewItem)) {#NEW All|eq @Item} {#SAY Item already databased.}
  }


There seem to be two problems with this: Even with a record that matches the name(made sure it was first column), the find function seems very unwilling to find any records in the database at all. Additionally, I can almost never seem to make it write a new record to the database, even if I manually command it to #New All|eq @Item. It seems like alot of the time it isn't even able to interact with the database at all. Has anyone else had any issues such as these? Thanks ahead of time.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Apr 06, 2004 12:21 am   
 
#IF (!%null( NewItem))

Obviously, you intended this to be @NewItem but it really doesn't matter. Neither NewItem nor @NewItem is a null-string so this #IF will always perform the #NEW. It should be:
#IF (@NewItem)


I have no idea why #NEW would not work, unless you don't have the eq database open.
Reply with quote
Calculus
Newbie


Joined: 05 Apr 2004
Posts: 2
Location: USA

PostPosted: Tue Apr 06, 2004 12:31 am   
 
Yeah thanks for catching the typo :X

And yeah, I don't know what I could be doing wrong with it not adding to the database. Like I'll open up the database and fiddle with the options for a second (just anything), then i'll ID a couple items and it will put them into the DB correctly, then stop again. Its really wierd.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Tue Apr 06, 2004 2:23 am   
 
Some changes to the DB structure seem to cause problems. These can be cleared up by simply closing and reopening the DB window.
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