NiCkReD
May 26th, 2005, 05:37 AM
hello,
i want to make a counter. It is something strange that i want to do.
Well, i want to check 2 variables and then if one variable is bigger/lower to increase/decrease a counter.
I had make one but the max number was only 1/-1
<SCRIPT>
<!--
R1=(will be from 0-1024);
R2=(will be from 0-1024);
var R11=0;
var R22=0;
var R3=0;
if (R1<100)
R11++;
if (R2<100)
R22++;
if (R11>R22)
R3++; //my problem is here. it can't take more than 1
if (R11<R22)
R3--; //same here
document.write(R11);
document.write(R22);
document.write(R3);
// -->
</SCRIPT>
also, i want to check it every 50ms if this could be possible....
could you please help me?
Thak you in advanced :)
i want to make a counter. It is something strange that i want to do.
Well, i want to check 2 variables and then if one variable is bigger/lower to increase/decrease a counter.
I had make one but the max number was only 1/-1
<SCRIPT>
<!--
R1=(will be from 0-1024);
R2=(will be from 0-1024);
var R11=0;
var R22=0;
var R3=0;
if (R1<100)
R11++;
if (R2<100)
R22++;
if (R11>R22)
R3++; //my problem is here. it can't take more than 1
if (R11<R22)
R3--; //same here
document.write(R11);
document.write(R22);
document.write(R3);
// -->
</SCRIPT>
also, i want to check it every 50ms if this could be possible....
could you please help me?
Thak you in advanced :)