I'll just be blunt here. Your code looks like total mushWhat you are basically doimng wrong is cramming as many executions into as few functions as possibhle. And your also cramming many operations into single line of code.

Here look at this.

A sample of your existing code.


write c:\stadistiques\up.txt 1r - $gettok(%uptime.topX.nicks,1,32) --> $duration($calc($gettok(%uptime.topX.times,1,32))) | if ($read(c:\stadistiques\nicks\$gettok(%uptime.topX.nicks,1,32).txt, 1) < $gettok(%uptime.topX.times,1,32)) { write -c c:\stadistiques\nicks\$gettok(%uptime.topX.nicks,1,32).txt $gettok(%uptime.topX.times,1,32) }

Now let's break it down and make it easier to read and comprehend.

; --------------------

alias nameoffunction {
var %top.nick = $gettok(%uptime.topX.nicks,1,32)
var %top.time = $gettok(%uptime.topX.times,1,32)
var %file1 = c:\stadistiques\nicks\ $+ %top.nick $+ .txt

var %compare = $read(%file1)
var %result = $iif(%compare < %top.time,1,0)

if %result {
write -c %file1
write %file1 %top.time
}
}

;-----------------

I didn't bother adding comments but I was simply trying to show you just how much easier it is to work with code that breaks things down into many small steps rather than one or two big ones.

You may not even care about what i'm trying to demonstrate to you. I really don't see much clean code on display in these forums. It's why I only wisit hem once in a blue moon.


Beware of MeStinkBAD! He knows more than he actually does!