|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: 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. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: 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. |
|
|
|
Scirkhan Apprentice
Joined: 14 Sep 2007 Posts: 167 Location: aztx
|
Posted: 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. |
|
|
|
|
|