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


Joined: 25 Apr 2003
Posts: 2

PostPosted: Fri Apr 25, 2003 1:16 pm   

Storing captured data
 
I have some data that I want to store and later retrieve, over how members in my team interact.
What I want to store is a tripple value:
Player A; Player B; Amount
So far I've done this with two data records, one that keep the pair Player A and Player B. The second concatunates their names into a key, and store the Amount as value. This works fine as long as Player A only appears once in the first record.

But if I then want the values
Player A; Player C; Amount2
then it doesn't work, since the key Player A already exists it'll replace the value Player B with player C in the first data record.

Is there some simple way to solve this problem?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Apr 25, 2003 4:07 pm   
 
Why do you need the first record? From what you said, you've already got both names in the key to the second record.
#ADDKEY Data {Player A - Player B} {amount}
#ADDKEY Data {Player A - Player C} {amount2}

LightBulb
Advanced Member
Reply with quote
Treacher
Newbie


Joined: 25 Apr 2003
Posts: 2

PostPosted: Fri Apr 25, 2003 4:11 pm   
 
Yes that is a simple way to store the data, but makes it more complicated to extract data for Player C, for example.
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Fri Apr 25, 2003 6:01 pm   
 
You are going to have to think of another way to store and extract the information. You are trying to use a record variable which by definition doesn't support what you want it to do (multiple equal keys mapping to different values).

Kjata
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Fri Apr 25, 2003 6:06 pm   
 
It's your choice. You can either have it easy to extract the data but complicated to store it, or easy to store it but complicated to extract it.

LightBulb
Advanced Member
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