View Single Post
  #4  
Old 11-08-2004, 09:36 PM
Slash-P2P Slash-P2P is offline
Banned
Join Date: May 2004
Location: Burning Blade
Posts: 941
Slash-P2P is on a distinguished road
Quote:
Originally Posted by Dach
If you mean getting the index value, no. Otherwise, please do clarify your post


PHP Code:
//--detecting element in list
  
if (strcontains(#s(foo),bar)) 

  
if (lindexof(bar,foo))

//--finding element in list
  
this.index lindexof(bar,foo);

  for (
i=0;i<sarraylen(bar);i++) {  //<- this is freaking ugly and I will hit you if you use it
    
if (strcontains(#I(bar,i),foo)) {
      
this.index i;
    }
  } 
It depends on what you are doing. As far as which function has the more efficient underlying code, I don't know. (only applicable in determining if an element is in a list though)
PHP Code:
//#CLIENTSIDE
if (created || playerenters) {
  
setstring this.accounts,some guy,foo;
  if (
strcontains(#s(this.accounts),#a)) {
    
message Your in the list;
  } else {
    
message Your not in the list;
  }

If your account is some or guy it will allow it but if you set the accounts string to "some guy","foo"; it only allows some guy and foo.
Reply With Quote