+ drive problems code

I am making a + drive attempted to use this code help, please and if this is not the right way to program an + drive please provide a correct example
//there is a while true line so it’s not that
if (vexRT(Ch1) < 20 && > -20)
{
backdrive = vexRT(Ch3);
fordrive = vexRT(Ch3);
leftdrive = vexRT(Ch4);
rightdrive = vexRT(Ch4);
}
else
if(vexRT(Ch1)<-20)
{
backdrive = vexRT(Ch1);
fordrive = vexRT(Ch1);
leftdrive = vexRT(Ch1);
rightdrive = vexRT(Ch1);
}
else
if(vexRT(Ch1)>20);
{
backdrive = vexRT(Ch1);
fordrive = vexRT(Ch1);
leftdrive = vexRT(Ch1);
rightdrive = vexRT(Ch1);
}

and go these errors
File “mainprogram v.1.c” compiled on Nov 14 2016 15:09:46
Error:Unexpected ‘>’ during parsing
Error:Unexpected ‘20’ during parsing
Error:Unexpected ‘)’ during parsing
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable
Error:Unexpected ‘else’. Ignored.
Error:Unexpected ‘if’ during parsing
Error:Missing ‘;’ before ‘{’
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable
Error:Unexpected ‘else’. Ignored.
Error:Unexpected ‘if’ during parsing
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable
*Severe:Can’t assign to ‘const’ qualified variable

Assuming that backdrive etc. are the names of your motors, then you need to assign values to them in the following way (as an example).

motor backdrive ] = vexRT(Ch3);

remove the semi-colons at the end of the “if” statements.

fix the statements like this.


if (vexRT(Ch1) < 20 && > -20)

to something like this.


if (vexRT(Ch1) > 20 || vexRT(Ch1)  < -20 )

Let us know how you get on.