Well, I've read the guide, I've checked out the help file and loked around in the boards, but I don't know why, but I just can't get a handle on how to use lists properly. Ive tried coding it different ways, Ive posted several time son why my code wont work.
Would anyone care to give me the code for this?
I need to make a list of names with numbers associated with each name.
I need to know how to search through the list of names for a name Im looking for and find out the number assiciated with it
I need to know how to remove the name and number
... and finally how to alter the number....
Sorry everyone.
ID:167563
Feb 25 2006, 2:24 pm
|
|
In response to Hell Ramen
|
|
thank you, but, I don't know how long the list will get, i need to let the procs throw names in at a whim so i cant be assigning a value to each one as a variable all the time. I can pile the names in then use a 'for' loop to find the name the process is looking for.
Any code for that? for example the name of a mob? for(Mob.name in mylist) if(Mob.name==name_in_the_list_in_the_list) The_Number=number_with_name bob, 20 jim, 21 amanda, 52 |
In response to karver
|
|
var/list/l=list("bob"=20,"jim"=21,"amanda"=52) You can access the associative value easily by doing that. |
In response to Hell Ramen
|
|
Awesome,
so if i want to cross reference a name and number i could do this? var/mob/M |
I need to know how to search through the list of names for a name Im looking for and find out the number assiciated with it
I need to know how to remove the name and number
... and finally how to alter the number....
I really don't know how to explain, so I just provided some code examples. =p
You can most likely play around with them and get what you wanted.