mIRC Homepage
Posted By: Lowest While Loop again - 22/02/03 06:39 PM
sorry to post again but no one answered when i replied in my other post

Code:
alias RemoveM3u { 
  var %m3u = $line(@filelist,N)
  while (%m3u > 0) {
    if (*.mp3* !iswm $line(@filelist,%m3u)) || (*.ogg* !iswm $line(@filelist,%m3u)) { dline @filelist %m3u | did -d player 8 %m3u }
    dec %m3u
  }
}   


this never worked so i tried to do this

Code:
alias RemoveM3u { 
  set %rme.fle .mp3 .ogg
  var %m3u = $line(@filelist,N)
  var %pup = 0
  while (%m3u > 0) && (%pup < $numtok(%rme.fle,32)) {
    inc %pup
    var %match.file = * $+ $gettok(%rme.fle,%pup,32) $+ * 
    if (%match.file !iswm $line(@filelist,%m3u)) {
      dline @filelist %m3u
      did -d player 8 %m3u 
      dec %m3u
    }
    else { dec %m3u }
  }
}  


but it still doesn't work confused
Posted By: Nimue Re: While Loop again - 22/02/03 06:45 PM
var %m3u = $line(@filelist,N) <- should be -> var %m3u = $line(@filelist,0)


Code:
alias RemoveM3u {
  var %i = 1
  while $line(@filelist,%i) {
    if $regex($ifmatch,/\.mp3$|\.ogg$/) { dline @filelist %i | did -d player 8 %i }
    else inc %i
  }
}
Posted By: Lowest Re: While Loop again - 22/02/03 06:54 PM
but N and 0 do the same thing right?

anyway it never worked frown

Edit: oh it kinda worked but it removed the files that I wanted to keep and kept the file i wanted to get rid of
Posted By: Nimue Re: While Loop again - 22/02/03 07:09 PM
Hm, you're right about the N returning the total lines.
And yes, sorry I missed the !iswm, sorry blush
Code:
alias RemoveM3u {
  var %i = 1
  while $line(@filelist,%i) {
    if !$regex($ifmatch,/\.mp3$|\.ogg$/) { dline @filelist %i | did -d player 8 %i }
    else inc %i
  }
}

Posted By: Lowest Re: While Loop again - 22/02/03 07:17 PM
thanks I've been trying to get this to work for days grin
© mIRC Discussion Forums