mIRC Home    About    Download    Register    News    Help

Print Thread
$i++.. how? #1506 13/12/02 09:07 PM
Joined: Dec 2002
Posts: 3
P
PHPAlien Offline OP
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Dec 2002
Posts: 3
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?


---------------------
PHP Dude
mIRC n00b
Re: $i++.. how? #1507 13/12/02 09:08 PM
Joined: Dec 2002
Posts: 20
S
Spola Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 20
/inc %i

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


you guys are so not L334
Re: $i++.. how? #1508 13/12/02 09:13 PM
Joined: Dec 2002
Posts: 3
P
PHPAlien Offline OP
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Dec 2002
Posts: 3
Yes I knew that.... Im just saying :P

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

Thanks for being speedy btw laugh


---------------------
PHP Dude
mIRC n00b
Re: $i++.. how? #1509 13/12/02 09:16 PM
Joined: Dec 2002
Posts: 208
C
Cobra Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
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^

Re: $i++.. how? #1510 13/12/02 09:18 PM
Joined: Dec 2002
Posts: 3
P
PHPAlien Offline OP
Self-satisified door
OP Offline
Self-satisified door
P
Joined: Dec 2002
Posts: 3
Yeh.. thats what it does...

Cheers! laugh


---------------------
PHP Dude
mIRC n00b
Re: $i++.. how? #1511 13/12/02 09:21 PM
Joined: Dec 2002
Posts: 208
C
Cobra Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 208
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^

Re: $i++.. how? #1512 14/12/02 03:15 PM
Joined: Dec 2002
Posts: 20
S
Spola Offline
Ameglian cow
Offline
Ameglian cow
S
Joined: Dec 2002
Posts: 20
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


you guys are so not L334