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


Joined: 15 May 2012
Posts: 15

PostPosted: Tue May 15, 2012 7:21 am   

Single Option field - input from mud {SOLVED}
 
Problem: Equipment Identification database--> a record field that is a Single Option. The name of the field is Slot
and a few of the options in the list are Neck, Legs, Head, Finger, etc.

My code:
#IF (%ismember(@dbview, @viewlist)) {#show @dbview} {@dbview = armor};#addkey item slot @itemtype;#NEW @dbview @item;#T- identify

Explanation:
/dbview/ is the view in the db. unless it matches something else in the viewlist, it will default to /armor/ as the view.
(#addkey item slot @itemtype) , @itemtype is the variable that holds the Slot choice (Legs for instance). Addkey adds it to /Item.slot/ .

sooo,
I checked Item, and its showing up with Legs so that part is working fine.

The (#new @dbview @item) is working correctly too, filling in everything else. The problem is the Slot, Single Option, field in the new record always is the first option in the list. It doesn't show legs like it should.

Is there a trick to getting a Single Option to chose the correct one?


Last edited by kohl on Wed May 16, 2012 11:05 pm; edited 1 time in total
Reply with quote
kohl
Beginner


Joined: 15 May 2012
Posts: 15

PostPosted: Wed May 16, 2012 3:59 am   
 
Fixed it. Took me hours of trying alternate solutions and looking for some command that I was missing, searching forums... I am new to coding, so I figured there was some command or syntax that I didn't have knowledge of.

before I finally gave up and went back to double check (again) what I had and see if it was something I could figure out.

Come to find out, that when I made my Option List, a large majority of the options I put in had a space before the option. ( Legs) instead of (Legs) for example. So when I sent the code for it to be set to Legs, it couldn't find it. All it had was _Legs.

So problem solved I guess. There was no mysterious code I was missing. Idea
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