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
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Sun Aug 07, 2011 11:09 pm   

%begins %ismember
 
I thought I created something that could use %begins and %ismember together. I need help with doing just that.
#if (%begins(@memberlist, Hasseyampa)) {yes} {no}
%ismember(%begins(@memberlist,Hasseyampa),@memberlist)

Or something..
can I use #forall, or something like that with an if statement? I want to check if any of the items begin with "whatever."
Something like %begins(%item(@memberlist,%numitems(@memberlist)), Hasseyampa)
Thank you.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Aug 07, 2011 11:25 pm   
 
I'm not understanding what you're wanting. Perhaps supply a real example.
_________________
EDIT: I didn't like my old signature
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Aug 07, 2011 11:27 pm   
 
Code:
#FORALL @memberlist {#IF %begins(%i,Hasseyampa) {do whatever}}

Keep in mind this will check every member in the list, even if one has already been found that begins with Hasseyampa. If you want it to stop after the first match, you might want to throw in an #abort.
Reply with quote
Scirkhan
Apprentice


Joined: 14 Sep 2007
Posts: 167
Location: aztx

PostPosted: Sun Aug 07, 2011 11:39 pm   
 
Thanks :)
I wanted something that would check if an item in my stringlist begins with "whatever"
I suppose I can use a variable with this as well. Need more than an abort, suppose I can use that too.

#trigger {spins out of control$} {#if (%ismember(%begins(),@randomVictims) {} {} }

Sorry, there isn't really a "real" example for this..... I'm using it to check if a line begins with something in a stringlist.
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