mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
i have this code:
Code:
alias  m.imdb {
  .fopen imdb imdb.txt
  if $ferr { echo -a read error | fclose imdb | return }
  .fseek -w imdb *Titles (Partial Matches)*
  if !$feof && !$ferr {
    while $fread(imdb) != </ol> {
      var %a = $v1
      if *Titles (Partial Matches)* iswm %a { blah blah stuff }
      else  blah blah or else stuff   }
  }
  .fclose imdb
}
  


with this code it returns all the results found under the match. but if theres like over 200 results that come up, it gets kinda overloaded. so is there anyway to have it limit the results to somewhere aound 50 results..???

any info on this will be appreciated ...
thanks

Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
this could be done with two ways..
1st: use filter and check for $filtered
2nd: set a variable on 1 and keep it increasing til it reaches 50

Code:
alias  m.imdb {
   [color:red]var %limit[/color]
  .fopen imdb imdb.txt
  if $ferr { echo -a read error | fclose imdb | return }
  .fseek -w imdb *Titles (Partial Matches)*
  if !$feof && !$ferr {
    while $fread(imdb) != </ol> {
      var %a = $v1
      [color:red]if (%limit = 50) break[/color] 
      [color:red]inc %limit[/color] 
      if *Titles (Partial Matches)* iswm %a { blah blah stuff }
      else  blah blah or else stuff   }
  }
  .fclose imdb
}


Kind Regards, blink
Joined: Aug 2004
Posts: 423
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Aug 2004
Posts: 423
thanks b1ink, that worked perfectly... cool


Link Copied to Clipboard