mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
Need a little help with removing the paths from a list of files, i am using:

Code:
 [color:red]
menu @lister {
  Remove Paths:{
    set %lines $line(@lister,0)
    while %lines > 0 {
      rline 4 @lister %lines $nopath($line(@lister,%lines))
      dec %lines 1
    }
  }
}
 [/color] 

which works great, but, it dont remove all of the paths, it removes SOME paths, then i have to rerun it, and do it again, like five or six times to remove all the paths, every thing looks great to me, but then again, if i was any good at scripting, i would have found my mistake by now.

Oh by the way, i am using:

Code:
 [color:green]alias lf {
  var %a = c:\music
  .comopen %a WScript.Shell
  if !$comerr {
    .comclose %a $com(%a,Run,3,bstr,command /c dir c:\music /a-D /s/b > $mircdirrawlist.txt,uint,0,bool,true) 
  }
  window -hels @Lister
  loadbuf @lister $mircdirrawlist.txt
  savebuf @lister $sound(mp3) $+ $mnick $+ _raw_mp3_list.txt
  echo -a 4 DONE PROCESSING $SOUND(MP3)
}
 [/color] 
to make the list and shove it to a custom @window


keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 144
D
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
Could you show us a few examples of the lines that are NOT filtered on the first try?


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
Joined: Dec 2002
Posts: 103
Vogon poet
Offline
Vogon poet
Joined: Dec 2002
Posts: 103
From first sounds of it, this sounds like a looping problem, however I don't see why as rline only replaces a line, not deletes it.

what happens if you try:

rline 4 @lister NEW %lines $nopath($line(@lister,%lines))

i.e. so after the first run all the lines should have NEW. If this is the case, there is probably an issue with the $nopath() -- perhaps there is a multiple white space issue going on.

Also try replace the rline command with echo, e.g.

echo rline 4 @lister %lines $nopath($line(@lister,%lines))

And check that the number of echo'd lines equals the number of lines in the @window. Check that %lines is set to the correct value before you start the loop.

HTH smile

Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
I made some screen shots that i hope will explain the problem. sorry bout the size of the pics, they are huge, my first screen shots ever. grin they are at THIS PLACE

as far as white space is cocerned, i dont think any of my files have ANY spaces in them i dont like it when files have spaces.

Last edited by keeker; 17/12/02 07:48 PM.

keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
If $nopath() isn't working, you could use $gettok($line(@lister,%lines),-1,92) to give you everything after the final \ in the string.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
i tried your $gettok thingy, and the same thing happened, it didnt do all of them in the first path.

if i cant figgure out how to do this with a popup, is there a way to strip the paths when i /loadbuf the list, or when i actually make the list?


keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
You will have to post a couple of lines for us to see (before and after). It is extremely difficult to script blindly (and accurately, anyway).


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
never mind yall, i will just go with one of the premade scripts that i trust like spr, i just wanted to see if i could actually make my own mp3 player, maybe in a few months i will try again. :tongue:


keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.

Link Copied to Clipboard