|
Churlant Novice
Joined: 17 Oct 2002 Posts: 44 Location: USA
|
Posted: Thu Oct 24, 2002 4:49 pm
matching from a list |
This is probably a simple question, but the whole problem is messing with me...
My mud is sci-fi based with various planets and commodity prices on each. I want to create a system which will check the price of a commodity on a planet, then add that planet name to a list if it is a location I do NOT want to visit.
Then I would like to be able to compare a captured variable to the list, and if that name is in the list, skip it and go on to the next comparison. I would also like to add names to the list.
I hope this makes some kind of sense...
>-Churlant-< |
|
|
|
dericpr Newbie
Joined: 13 Sep 2002 Posts: 6 Location: Canada
|
Posted: Thu Oct 24, 2002 5:51 pm |
sounds like a stringlist variable will help here.
Create a variable, make it a string list.
You can add items by a trigger or on the commandline using
#additem <stringlist> <item>
or delete items
#delitem <stringlist> <item>
and check whether something is a member of yoru string list
#if %ismember(@commodity, @stringList) { <true stuff> } { <false stuff> }
look up stringlist in the help for more details.. |
|
|
|
Churlant Novice
Joined: 17 Oct 2002 Posts: 44 Location: USA
|
Posted: Thu Oct 24, 2002 6:05 pm |
Thanks! I was trying to find help from the online zmud help file, but kept searching for the wrong terms... my stupid moment for the day.
>-Churlant-< |
|
|
|
|
|