Help with searching a file - 11/09/03 04:36 PM
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..
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!
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!