mIRC Home    About    Download    Register    News    Help

Print Thread
#48780 11/09/03 04:36 PM
Joined: Jan 2003
Posts: 148
K
Knappen Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
Hi!

I have this code that is supose do work kinda like the same way when you press the J button in WinAmp... It`s suppose to search the file for matches to the input word..

Code:
 

dialog søk {
  title "Search
  size -1 -1 130 150
  option dbu

  edit "", 1, 11 10 90 11
  button "&Search", 2, 105 10 20 11, disable default

  list 3, 10 25 115 110

  button "&OK", 4, 70 135 25 13, ok
  button "&Cancel", 5, 40 135 25 13, cancel
}

on *:dialog:search:edit:1:{
  if ($did(1) != $null) { did -e $dname 2 }
  else { did -b $dname 2 }
}

on *:dialog:search:sclick:*:{
  if ($did == 2) {
    var %lines = $lines(mp3list.lis)
    var %num = 1
    var %match
    while (%lines >= %num) {
      $read(mp3list.lis, tw, * $+ $did(1) $+ *, %num)
      %match = $read(mp3list.lis, $readn)
      did -i $dname 3 %num %match
      inc %num
    }
  }
}

 


What this doeas at the moment is that it searches the mp3list.lis file and returns the first match many times and then all the other matches.. Whats wrong? Can anyoe help me?

Thanks! smile

Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
personally I would open a window and /filter -fw filename windowname *keyword*


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Feb 2003
Posts: 23
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Feb 2003
Posts: 23
He is using a dialog as output so -o would be handy here,also because he searches something,an alphabetic order would be handy (-t).


Use this instead:
Code:
  
on *:dialog:search:sclick:2:{ filter -fot mp3list.lis $dname 3 $did(1) }

Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
He wanted matches - he never said anything about alphabetically sorted...


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Feb 2003
Posts: 23
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Feb 2003
Posts: 23
It's a lill' extra :tongue:
And btw if he doesn't want the alphabetically sorted thingy he just has to remove the t in -fot.

Joined: Jan 2003
Posts: 148
K
Knappen Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Jan 2003
Posts: 148
Thanks for your help! But the filter command doesnt work.. /filter: invalid parameters

But I got it to work now.. with this code: if ($did(1) isin $read(mp3list.lis, %num))

But when i search for a song and it finds match(s), each match gets added twice..
Why? Is there a way to get rid of the second entry?


Link Copied to Clipboard