
Robotc code examples code#
Again, if you start above the first line of code that looks wrongly indented you should be able to track down your error. You can see in the above code listing that task main() and its body are indented (pushed to the right). Unreferenced function / Undefined Procedureįrom the following code: void movForward ( float inches )
Robotc code examples full#
This may look complicated to those unfamiliar with it, but all this does is tell two motors to go at full power for 32.6 seconds. Here is an example of a very simple RobotC code. It is based off the actual C code that is used in some computers. In a perfect world you should strive to have no messages at all in the Compiler Errors window pane, your code will generally be cleaner. RobotC is a programming language for robots built with the VEX system. Error something is broken and you need to fix it.The compiler is pretty sure you wanted to use it, but you’re not. You write a function moveForward(float inches) but it’s not being used. Warning the compiler is pretty sure this thing will cause a problem, just maybe not right now.Maybe you defined a variable to use somewhere else, but deleted that other code, so that variable is hanging around for no reason. These messages are really just to help you keep your code clean, as far as the compiler can tell they don’t have the potential to cause any problems. Info nice to know information that the compiler discovered.Let’s quickly chat about the various Message Types: What type of message this is (Error, Warning, Info).What line number the compiler is talking about.Looking at the above screenshot there’s actually a lot of information there: First let’s look at where you can find your compiler messages:Ĭompiler Messages show up in a window pane at the bottom of the ROBOTC IDE. Sometimes the messages you get back from the compiler aren’t completely obvious, but the more familiar you get with them the easier it’ll be to figure out what’s wrong with your program.

Here’s the sign that you did something wrong: Compiler ErrorsĬompiler Errors will, unfortunately, be a fact of life as a programmer.

Once you’ve found it, then look at the details for that section and most importantly the FIX listed in each section.
