Does ROBOTC have an and statement?


#1

Hello Vex Forum,
My team and I have been having coding problems with our robot and we are testing around. We are getting close to something, but it involves the and statement used in python Ex. if(x = 1 and y = 2).
Right now our current line of code is
else if (SensorValue[dgtl8] == 1 && SensorValue[dgtl1] == 1).
We are trying to find out if there is an and statement, if you know please help.

Thanks,
6722C Team


#2

…you’re already using an and operator, though? It’s


&&

. It’s right there in your


else if

's conditional.


#3

The double ampersands ( or &&) is what I have always used in RobotC for an and statement.