Hello Horstl,

Wow, your work ceases to amaze my ever growing mIRC fascinations to their fullest extent possible.

The performance of the Fopen / Fwrite stuff is unbelievable 220ms to 15ms for 100 lines.

How in the world, would you relate this function back into your previous example that you had provided to me? This would make it unbeleivably fast and probably not to mention use less resources to compile it.

Code:
; usage: /listinfo [nick|address|IP|mail]

alias listinfo {
  if ($findtok(nick address IP mail,$1,32)) { var %column = $v1 }
  else { echo -a Syntax: /info [nick|address|IP|mail] | return }

  if (!$hget(ipinfo,1).item) { echo -a table "ipinfo" is empty. }
  else {
    ; $mircdir, to ensure write permission on all systems. $qt to play safe with spaces in folder names.
    var %tempfile = $qt($+($mircdir,IPinfoDump.txt)), %outfile = $qt($+($mircdir,Report_IPInfo.txt)), %n = 1

    ; dump table to tempfile (write -c to ensure an empty tempfile)
    write -c %tempfile
    hsave -i ipinfo %tempfile
    ; sort data in tempfile
    write -dl1 %tempfile
    filter -ffct %column 44 %tempfile %tempfile

    ; heading lines of outfile
    write -c %outfile Report runtime: $+($asctime(ddd mmm dd @ HH:nn:ss),.) There are $lines(%tempfile) item(s) listed.
    write %outfile Report compiled by: $replace($1,ip,IP address,mail,E-mail) 
    write %outfile $str(-,30) $crlf $crlf

    ; for the "show the sort-by column in first place" idea
    var %denote = Nick: Address: IP: eMail:

    ; loop lines of tempfile
    while ($read(%tempfile,%n)) {
      var %read = $gettok($v1,2-,61), %line, %t = 1
      ; insert denotations
      while ($gettok(%read,%t,44)) {
        var %line = $addtok(%line,$gettok(%denote,%t,32) $v1,44)
        inc %t
      }
      ; write data to outfile; sortby-column in first place
      tokenize 44 $deltok(%line,%column,44)
      write %outfile $gettok(%line,%column,44) >>> $1- $crlf $crlf
      inc %n
    }

    ; remove the tempfile and run the outfile
    .remove %tempfile
    run %outfile

  }
}


Thanks for showing me this....im sure ill be using this now once I figure this out completely.

Thanks again for everything!

Cheers,

Jay.

Last edited by Buggs2008; 15/11/08 07:20 AM.