|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 2,265 |
not sure if its a problem with my script or a bug... but:
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:
...$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:
/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:
.fseek -w mp3list $2-
and
.fseek -w mp3list $+(*,$2-,*)
any ideas greatly appreciated :tongue:
new username: tidy_trax
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
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.
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
OP
Hoopy frood
Joined: May 2003
Posts: 2,265 |
i came up witha big workaround, course it has extra stuff and wont work for anyone else
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
|
|
|
|
|