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


Joined: 29 Apr 2001
Posts: 8

PostPosted: Sat Aug 10, 2002 6:51 pm   

Database output question
 
I'd like to 'say' item names and their stats when i query the dbase. Here is the alias im using:

#al {find} {#FORALL %find("%-1") {%dbget(%i)," ");say &Item - &Stats}}

I have three fields in the dbase: Item, Stats and Date.

so if I type:
find glimmering

It should 'say': Item name - Stats. Here is my output:

(Num789arItema suit of glimmering chainmailStatsAC18 +2+1 noburn Anti-Mage-Cleric Anti-EvilDate20020805, )

then:

You say 'a purple silk shawl - AC4 5hps 9cha'

a purple shawl is the first record in my dbase and is 'said' no matter what item I query.

Any ideas how to get the output to be the correct items stats instead of the first item in my dbase all the time? :)

Thanks in advance for any help.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Sat Aug 10, 2002 9:38 pm   
 
You have the correct idea, but you are using some stuff from other zMUD commands. What you want is this:
#ALIAS find {#FORALL %find("%-1") {say %db(%dbget(%i), "Item") - %db(%dbget(%i), "Stats")}}

Kjata
Reply with quote
Zapple
Newbie


Joined: 29 Apr 2001
Posts: 8

PostPosted: Sat Aug 10, 2002 11:25 pm   
 
Thanks so much! Works perfectly :)
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