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
Indica
Beginner


Joined: 25 Mar 2003
Posts: 18

PostPosted: Sat Mar 29, 2003 12:11 am   

%dbget / %expanddb
 
is their anyway to use %dbget or %expanddb and control the output, have it in my own format, and/or only print certain fields of information


Thanx,

Indica
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Mar 29, 2003 1:20 am   
 
Yes.

LightBulb
Advanced Member
Reply with quote
Indica
Beginner


Joined: 25 Mar 2003
Posts: 18

PostPosted: Sat Mar 29, 2003 1:29 am   
 
and what do i do to do that????
Lets say i have 3 fields:

Name
Keyword
Value

but i only want to show Name & Keyword, how do i do that?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Mar 29, 2003 2:14 am   
 
%dbget()
#VAR display {%dbget( 1)};#SHOW {%db( @display, Name) %db( @display, Keyword)}

%expanddb()
#DBGET 2;#VAR display2 {%expanddb( %rec, "|", "|"};#SHOW {%item( @display2, %ismember( "Name", @display2) + 1) %item( @display2, %ismember( "Keyword", @display2) + 1)}

Of course, it would be easier to just use %db() directly.
#SHOW {%db( 3, Name) %db( 3, Keyword)}

LightBulb
Advanced Member
Reply with quote
Emit
Magician


Joined: 24 Feb 2001
Posts: 342
Location: USA

PostPosted: Sat Mar 29, 2003 2:15 am   
 
Unfortunately %expanddb will show all fields of the variable. A good solution might be to write your own function to format it the way you want:

#var dbv ""
#addkey dbv Name dbvNAME
#addkey dbv Keyword dbvKEYWORD
#addkey dbv Value dbvVALUE
// we'll use this one for testing
#func showdbv {Name->@%1.Name Keyword->@%1.Keyword}
#show @showdbv(dbv)

This displays:
Name->dbvNAME Keyword->dbvKEYWORD

You can call @showdbv on any db var with fields Name and Keyword.

--------

moon.icebound.net:9000
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sat Mar 29, 2003 3:11 am   
 
Lighbulb was correct in what he wrote but because the poster did not supply the info here ,he could not make it for him.

It is always appreciated when people help but plaese take the time to read the help manual and do searchs


at anyrate I sent you someting through Email that will help your spicific needs.

as to the rest of you this is how i solved what he asked me directly and seems to apply here:

#CLASS {new}
#TRIGGER {^({@bonus}): {+|-}(%D)} {#ADDI bonus1 %replace("%1","Bonus-","") %2 %3}
#TRIGGER {^({@req}): (%d)} {#ADDI req1 %replace("%1","Req-","") %2}
#TRIGGER {^Classes:(*)} {#VAR class1 "%1"}
#TRIGGER {^Weapon:(*)} {#VAR weapon1 "%1"}
#TRIGGER {^Type:(*)} {#VAR type1 "%1"}
#TRIGGER {^Name:(*)} {#VAR name1 "%1"}
#TRIGGER {^Keywords:(*)} {#VAR key1 "%1"}
#TRIGGER {^Value:(*)} {#VAR value1 "%1"}
#TRIGGER {^$} {#ECHO @name1;#ECHO @key1;#ECHO @value1;#ECHO @type1;#ECHO @weapon1;#ECHO @Class1;#ECHO %replace(@req1,"|"," ");#ECHO %replace(@bonus1,"|"," ");#T- new}
#CLASS 0

put these somewhere not in the above class

#VAR req {Req-lvl|Req-con|Req-spe|Req-agi|Req-dex|Req-str|Req-wil|Req-int|Req-wis}
#VAR bonus {Bonus-hit|Bonus-dam|Bonus-hp|Bonus-mana|Bonus-spirit|Bonus-con|Bonus-spe|Bonus-agi|Bonus-dex|Bonus-str|Bonus-wil|Bonus-int|Bonus-wis|Bonus-ac|Bonus-nat|Bonus-quick}



megamog75
Keeper of the only printable help files for Zmud.
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