|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: 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 |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: 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 |
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: 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
vs the output in the help file, i.e.
Code: |
Displays: 2
Displays: Race=Dwarf |
|
|
_________________ Asati di tempari! |
|
|
|
oldguy2 Wizard
Joined: 17 Jun 2006 Posts: 1201
|
Posted: 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.
|
|
|
|
chamenas Wizard
Joined: 26 Mar 2008 Posts: 1547
|
Posted: 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 ;)
|
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Sun Oct 10, 2010 5:36 am |
I've gone ahead and updated the documentation.
|
|
_________________ Asati di tempari! |
|
|
|
|
|