|
TerrellKl Novice
Joined: 30 Aug 2005 Posts: 49
|
Posted: Thu Sep 29, 2005 6:07 pm
collecting the value off a random Key |
#addkey playerc1 %item( @list, %random( %numitems( @list))) (i dunno what to put here to make it the same value from the random item)
eh.. %item doesnt work.. need to find out what it is for database records(variable). any help is appriciated
In short, what i need to do is capture a random Key and the key's Value from a Database record and put it in a variable. HELP! |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Sep 29, 2005 9:01 pm |
If I get this right then you are seeking to generate a random number based on how many keys you have in a record variable. You then wish to retrieve a key and value pair that happens to match that random position. If I am right then you are looking for something like:
PlayerC1=%item(%expanddb(@recordVar,"|"),%random(%numkeys(@recordVar)))
This will produce an output similar to Key=Value. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|