I am trying to compair two values in a pre test befor executing a control statement within an if statement.
The syntax I am using is as follows...
total = if ((tangent1 > 0) && (momDelta < 0)) {
tangent1 - Math.abs (momDelta);
}else {
tangent1 + momDelta;
}
I keep getting a syntax error on the pre test line. I am trying to do something like this.
If Tangent 1 is greater than 0 and Mom Delta is less than 0, then do this.
Also, is my math (abs.) function done properly as well???
Also later on in the code I am trying to test to see if a value for (x) is greater than or equal to (y). The syntax I am using for that is
If (x > || == y) {
tangent1 + mom;
}
else {
mom - tangent1;
}
Any help is appreciated,
John
The syntax I am using is as follows...
total = if ((tangent1 > 0) && (momDelta < 0)) {
tangent1 - Math.abs (momDelta);
}else {
tangent1 + momDelta;
}
I keep getting a syntax error on the pre test line. I am trying to do something like this.
If Tangent 1 is greater than 0 and Mom Delta is less than 0, then do this.
Also, is my math (abs.) function done properly as well???
Also later on in the code I am trying to test to see if a value for (x) is greater than or equal to (y). The syntax I am using for that is
If (x > || == y) {
tangent1 + mom;
}
else {
mom - tangent1;
}
Any help is appreciated,
John
Comment