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
geosmith
Wanderer


Joined: 23 Apr 2005
Posts: 57

PostPosted: Thu Jul 28, 2005 6:53 am   

Problems using %ismember
 
Hi there,

Basically I'm trying to use #IF and %ismember to determine whether any of the values stored within a string list occur on another string list, then have a particular event occur if they don't.

I've tried the following...

#if (%ismember(@variableA,@variableB)) {} {result}

... but with little success.

I've tried to avoid using "#FO @variableA", on the grounds that I want the result to occur only if -none- of the values of variableA are on variableB, not for every single one that isn't.

Any advice on this would be appreciated.
Reply with quote
Full Throttle
Wanderer


Joined: 07 Dec 2004
Posts: 65

PostPosted: Thu Jul 28, 2005 8:28 am   
 
#variable member_count 0
#forall @list_a {#if %ismember(%i,@list_b) {#add member_count 1}}
#if (@member_count = 0) {#echo no common members}
Reply with quote
geosmith
Wanderer


Joined: 23 Apr 2005
Posts: 57

PostPosted: Thu Jul 28, 2005 8:40 am   
 
Perfect, thanks! Very Happy
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