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
Churlant
Novice


Joined: 17 Oct 2002
Posts: 44
Location: USA

PostPosted: 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-<
Reply with quote
dericpr
Newbie


Joined: 13 Sep 2002
Posts: 6
Location: Canada

PostPosted: 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..
Reply with quote
Churlant
Novice


Joined: 17 Oct 2002
Posts: 44
Location: USA

PostPosted: 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-<
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