I’m unable to get the do{ statements }while(expression) to work using ROBOTC 4.55 and a Cortex (Clawbot).
Has anyone had success using this control structure? If so, any short sample code would help tremendously.
Thanks,
Dave
The do-while construct is very similar to a while construct except that the test for completion is moved to end rather than being at the beginning.
So code like this
task main()
{
while( true ) {
motor[port1] = vexRT Ch2 ];
wait1Msec(10);
}
}
could be rewritten to look like this.
task main()
{
do {
motor[port1] = vexRT Ch2 ];
wait1Msec(10);
} while( true );
}