mIRC Homepage
hey how can i remove lines from my variable that does not start with a #

#rgwgihwg
#wqeignwgåinp
wqeginwqgnå
#wqingåg
#wkgnnkpgw

i want to remove "wqeginwqgnå"
and then only have

#rgwgihwg
#wqeignwgåinp
#wqingåg
#wkgnnkpgw

left

how can i do that ?
Im gonna assume you have them all in one variable seperated by spaces.

var %varablename = $remove.non.hashed(%varablename)

Code:
alias remove.non.hashed {
  var %t
  tokenize 32 $1-
  while ($1) {
    if (#* iswm $1) { var %t = %t $1 }
    tokenize 32 $2-
  }
  return %t
}
no they are seperated by "line feed" or what its called in eng.

like i wrote them
#wpgiwp
#rwijgipg
#wpigpigw
ewjigopog
#owrgo

not
#wrngpin #wepipgiw #pijwgpig pingigw #ipwegpig
like that
ahhh but it works anyway

thanks
now it do laugh

alias remove.non.hashed {
var %t
tokenize 13 $1-
while ($1) {
if (#* iswm $1) { var %t = %t $1 }
tokenize 13 $2-
}
return %t
}
13 is cariage return /help $cr
10 is line feed /help $lf

Sounds like it might have worked by chance likely there is #blah<space><cariage return> maybe not, The second "tokenize 13" should have caused it to go astray since the first one would have sepearted it on 13's but replaced them with spaces.

Try out.


var %varablename = $remove.non.hashed(%varablename)

Code:
alias remove.non.hashed {
  var %t = $1-
  var %i = $numtok(%t,13)
  while (%i) {
    if (#* !iswm $gettok(%t,%i,13)) { var %t = $deltok(%t,%i,13) }
    dec %i
  }
  return %t
}
thanks
© mIRC Discussion Forums