mIRC Home    About    Download    Register    News    Help

Print Thread
/fseek #47455 05/09/03 05:07 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
not sure if its a problem with my script or a bug... but:
Code:
alias mp3.search {
  if ($fopen(0)) && ($fopen(mp3list)) {
    if ($1 == -n) {
      .fseek -w mp3list $2-
      if ($2- != $fread(mp3list)) { .echo -q $input(Couldn't Find $+(",$2-,"),owd,Not Found) | return }
      .splay $fread(mp3list)
    }
    elseif ($1 == -w) {
      .fseek -w mp3list $+(*,$2-,*)
      if ($+(*,$2-,*) !iswm $fread(mp3list)) { .echo -q $input(Couldn't Find $+(",$2-,"),owd,Not Found) | return }
      .splay $fread(mp3list) 
    }
  }
}

then i use:
Code:
  ...$iif($fopen(0) && ($fopen(mp3list)),Normal,$style(2) $+ Normal) $+ : mp3.search -n $input(Search For?,eqd,Search)
  ...$iif($fopen(0) && ($fopen(mp3list)),WildCard,$style(2) $+ WildCard) $+ : mp3.search -w $input(Search For?,eqd,Search)

doesn't work.
from the help file:
Code:
/fseek <name> <position>

Sets the read/write pointer to the specified position in the file. The following switches may also be used to move the file pointer:

 -w <name> <wildcard>


so my /fseek -w's should work, but they dont, anyone see a problem or is it a bug, i think this is the bit that doesn't work:
Code:
.fseek -w mp3list $2-

and

.fseek -w mp3list $+(*,$2-,*)

any ideas greatly appreciated grin :tongue:


new username: tidy_trax
Re: /fseek #47456 05/09/03 11:15 PM
Joined: Dec 2002
Posts: 2,809
C
codemastr Offline
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
/fseek -w and /fseek -r (for me at least) don't seem to always work. I'd say it's a bug.

Re: /fseek #47457 05/09/03 11:34 PM
Joined: May 2003
Posts: 2,265
P
pheonix Offline OP
Hoopy frood
OP Offline
Hoopy frood
P
Joined: May 2003
Posts: 2,265
i came up witha big workaround, course it has extra stuff and wont work for anyone else grin
Code:
alias mp3.search {
  if ($fopen(0)) && ($fopen(mp3list)) {
    if ($1 == -n) {
      .echo -q $read(mp3list.txt,w,$2- $+ .mp3)
      .set %mp3.num $readn
      .fseek -l mp3list %mp3.num
      if ($2- $+ .mp3 != $fread(mp3list)) { .echo -q $input(Couldn't Find $+(",$2-,"),owd,Not Found) | return }
      .splay $fread(mp3list)
    }
    elseif ($1 == -w) {
      if ($findfile(%mp3.dir,$+(*,$2,*,.mp3),0) <= 1) {
        .echo -q $read(mp3list.txt,w,$+(*,$2-,*,.mp3))
        .set %mp3.num $readn
        .fseek -l mp3list %mp3.num
        if ($+(*,$2-,*,.mp3) !iswm $fread(mp3list)) { .echo -q $input(Couldn't Find $+(",$2-,"),owd,Not Found) | return }
        .splay $fread(mp3list) 
      }
      else {
        if ($input(More Than 1 File Found $+ $chr(44) $+ Open List Dialog?,ywd,Multiple Files) == $true) { 
          if (!$dialog(seek)) { dialog -m seek seek }
          .echo -q $findfile(%mp3.dir,$+(*,$2,*,.mp3),0,did -a seek 1 $remove($nopath($1-),.mp3))
          .did -z seek 1
        }
      }
    }
  }
}


new username: tidy_trax