mIRC Homepage

$i++.. how?

Posted By: PHPAlien

$i++.. how? - 13/12/02 09:07 PM

Ello!

In PHP you can do this: $i++ (or ++$i) but Ive tried it in mIRc with loads of different alterantives and no luck. Is this even possible?
Posted By: Spola

Re: $i++.. how? - 13/12/02 09:08 PM

/inc %i

(note that variables start with %'s in mIRC :tongue:)
Posted By: PHPAlien

Re: $i++.. how? - 13/12/02 09:13 PM

Yes I knew that.... Im just saying :P

Is there away to use PHP's $var += 6; ??

Thanks for being speedy btw laugh
Posted By: Cobra

Re: $i++.. how? - 13/12/02 09:16 PM

there is a way to do anything, and although i do code in php i've never seen nor used '+=' and rather than look it up i'm gona guess that it just adds 6 to the existing var?

if so /inc %var 6
is your answer smile

Note: you can also /dec .. type /help /inc or /help /dec for more info

if it was a typo and u ment .= .. i do know that in php, and mirc = of that would be as doing %var = %var $+ 6
or %var = $+(%var,6)

Cobra^
Posted By: PHPAlien

Re: $i++.. how? - 13/12/02 09:18 PM

Yeh.. thats what it does...

Cheers! laugh
Posted By: Cobra

Re: $i++.. how? - 13/12/02 09:21 PM

ok, figured

%var = $calc(%var + 6)
%var = %var + 6

would both also do the same thing as

inc %var 6

however u wana do it realy.

Cobra^
Posted By: Spola

Re: $i++.. how? - 14/12/02 03:15 PM

alternitavely, (for all the hardknocks):

Code:
alias i inc % [ $+ [ $$1 ] ] $2 | return % [ $+ [ $$1 ] ]


now you can use:
Code:
while ( $i( i) < 16 ) { echo %i YEAH! }


It's not tested, but i bet it works
© 2021 mIRC Discussion Forums