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
Zillat
Newbie


Joined: 31 May 2008
Posts: 8

PostPosted: Sun Jun 01, 2008 3:22 pm   

You can easily help me, i'm sure of it! Just need a command.
 
This is an easy problem, i'm just looking for a command.

I have a list, and i want to check if an item is on the list. If i isn't, i'll perform some tasks relating to the item then add it to the list.
It's a list of "items i've done stuff too" baiscly.

Please help! Thank you.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Sun Jun 01, 2008 5:03 pm   
 
%ismember as in #if %ismember(%1,@ListOfStuff) {do something if it is} {do something if it isn't}
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jun 01, 2008 5:05 pm   
 
Nope, there's no command. There's a function, though, called %ismember(). This will return the number of the first item that matches, or 0 if it doesn't exist in the stringlist.

To use it like you want, you'll probably want the #IF command:

#IF (%ismember(item to look for, "stringlist to look in")) {stuff to do if on the list} {stuff to do if not on the list}
_________________
EDIT: I didn't like my old signature
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