|
Treacher Newbie
Joined: 25 Apr 2003 Posts: 2
|
Posted: 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? |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
Treacher Newbie
Joined: 25 Apr 2003 Posts: 2
|
Posted: 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.
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: 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 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: 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 |
|
|
|
|
|