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
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Oct 06, 2010 11:22 pm   

[3.30] Helpfile: %isvalue and %item
 
The help file for %isvalue states:

Quote:
It actually returns the position of the value in the database record for use with %item to retrieve the key.

#SHOW %item(@dbvar, %isvalue(@dbvar,"Dwarf"))
Displays: Race=Dwarf


This is not the case. It only shows the value again or Dwarf and not the key.


Last edited by oldguy2 on Sun Oct 10, 2010 6:32 pm; edited 1 time in total
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Wed Oct 06, 2010 11:39 pm   
 
That should be changed to state you can use %dbkey with it to retrieve the key?

Code:
#SHOW %dbkey(@dbvar, %isvalue(@dbvar,"Dwarf"))
Displays: Race
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Oct 07, 2010 3:34 pm   
 
I'm not sure if the help files have been updated, but the example posted works fine for me. The only discrepancy is the output is
Code:
2
Dwarf

vs the output in the help file, i.e.
Code:
Displays: 2
Displays: Race=Dwarf
_________________
Asati di tempari!
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Thu Oct 07, 2010 7:48 pm   
 
Yes but according to to the help file it says "It actually returns the position of the value in the database record for use with %item to retrieve the key." You can't retrieve the key with %item.
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Thu Oct 07, 2010 8:35 pm   
 
The help file is old. Hopefully it will be updated, but that's the only problem. %dbkey, as you mentioned, is the new replacement for that and using %isvalue with %dbkey works just fine. You could also just make a comment in the helpfile ;)
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sun Oct 10, 2010 5:36 am   
 
I've gone ahead and updated the documentation.
_________________
Asati di tempari!
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