mIRC Home    About    Download    Register    News    Help

Print Thread
Noob Question. #248605 13/10/14 03:21 PM
Joined: Oct 2014
Posts: 17
D
drowsy Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Oct 2014
Posts: 17
Is there a way to calculate how many lines of code there is inside .ini files?

Re: Noob Question. [Re: drowsy] #248606 13/10/14 03:39 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Use $ini.
Example:
Code:
alias inicount {
var %file $iif(.ini isin $1,$1,$1 $+ .ini)
var %i 1 
var %p $ini(%file,0)
var %n %p
while (%i <= %p) {
inc %n $ini(%file,%i,0)
inc %i
}
echo -ag The total number of lines in %file are: %n 
}
Untested, but should work. (I don't have access to a mIRC application right now)
Use /inicount file


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net
Re: Noob Question. [Re: Nillen] #248607 13/10/14 03:53 PM
Joined: Oct 2014
Posts: 17
D
drowsy Offline OP
Pikka bird
OP Offline
Pikka bird
D
Joined: Oct 2014
Posts: 17
Thanks

Re: Noob Question. [Re: drowsy] #248610 13/10/14 05:19 PM
Joined: Dec 2008
Posts: 1,512
westor Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,512
Also i think $lines will help too, e.g: //echo -a $lines($mircini)


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Re: Noob Question. [Re: westor] #248612 13/10/14 07:30 PM
Joined: Dec 2013
Posts: 779
N
Nillen Offline
Hoopy frood
Offline
Hoopy frood
N
Joined: Dec 2013
Posts: 779
Oh, that's right! I completely forgot that you could use $lines for stuff other than .txt files. ^^


Nillens @ irc.twitch.tv
Nillen @ irc.rizon.net