Programming instructions

Reference
Project Lead The Way
©
and Carnegie Mellon Robotics Academy
©
/ For use with VEX
®
Robotics Systems
Error Messages in ROBOTC Code 3
Common Error Messages
The example below contains two syntax errors: a missing curly brace on line 2 and a missing
semicolon on line 6. Once again, you should try to correct the rst error in the program before
moving on.
The rst error message comes up on line 4, saying “**Error**:Expected->’{‘. Found ‘int’”. When the
word “Expected->” appears in the Errors display screen, it usually indicates that a piece of syntax
is missing. In this case, it expected to nd the missing curly brace immediately after task main(),
but found the reserved word int instead. To correct this error, you should add the opening curly
brace on line 2 and then recompile your code.
After recompiling your code, any remaining errors will be displayed. Missing semicolons also
display an “Expected->” style error message, but notice that the error for the missing semicolon on
line 6 appears on line 7. This is because the compiler ignores whitespace (blank lines, spaces and
tabs), but expected a semicolon before it encountered the wait command. To correct this error, you
should add a semicolon after the forward command.
Error Messages in ROBOTC Code
Go to Reference Links