Programming instructions

Reference
Project Lead The Way
©
and Carnegie Mellon Robotics Academy
©
/ For use with VEX
®
Robotics Systems
Error Messages in ROBOTC Code 7
Common Information Messages
Information messages will not prevent your program from compiling or downloading to your robot.
They only notify you regarding possible inefciencies in your code.
The most common occurrence of information messages are unused variables in your code. In the
example below, the integer variable speed is created and initialized, but never actually used in the
program. This is indicated in the Errors display screen with the message: “‘speed’ is written but
has no read references”.
Error Messages in ROBOTC Code
You do not need to correct this message, but you can in two ways:
1. Eliminate the code on line number 4, deleting the variable.
2. Call the speed variable in the forward command on line 6, in place of the integer 63.
Handling other Error Messages
Learning how to program robots isn’t easy; it’s no different than learning a foreign language. This
document covers how to handle some of the more common mistakes and error messages that you
may encounter, but you may run into others. That said, here are some general rules for dealing
with all error messages:
Determine if the message is an error, a warning, or just information. The message may not
even require additional work on your part!
Read the error message for clues! Error messages aren’t always the most intuitive, but they
always contain some information about what the compiler found.
When your program contains multiple errors, x them one at a time, recompiling your code
after each x. The “ripple” effect can make it seem like there are errors even if the rest of your
program is perfect.
Pseudocode, pseudocode, pseudocode! Make sure you have a plan in place before you try
to write a complex program. That way you can work out the logic rst, without having to worry
about it and the syntax, spelling and capitalization at the same time.
Go to Reference Links