Author |
Message |
Jkiss427
Rookie
Joined: Sun Jul 07, 2013 11:48 am Posts: 11
|
 Virtual Worlds
when I try to do the moving forward part in the labyrinth program it doesn't recognize and . Please help me.
|
Sun Jul 07, 2013 6:25 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Virtual Worlds
Please post your whole code
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Sun Jul 07, 2013 6:32 pm |
|
 |
parkway
Moderator
Joined: Mon Oct 04, 2010 2:18 pm Posts: 196
|
 Re: Virtual Worlds
Yeah, please post your entire code. Your error statements may be on those lines, but the curly braces may not be the issue. Please post your code and we'll see what we can do to help.
|
Sun Jul 07, 2013 6:43 pm |
|
 |
Jkiss427
Rookie
Joined: Sun Jul 07, 2013 11:48 am Posts: 11
|
 Re: Virtual Worlds
That is the only thing on those line.
|
Sun Jul 07, 2013 8:08 pm |
|
 |
Jkiss427
Rookie
Joined: Sun Jul 07, 2013 11:48 am Posts: 11
|
 Re: Virtual Worlds
When I try to Compile and Download, I get error messages regarding the lines with the curly braces. What I am trying to complete is the labyrinth. I follow the videos but the error messages keep popping up.
|
Sun Jul 07, 2013 8:19 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Virtual Worlds
No, we need all the code you have in your file. If your entire code is just Then you're missing a LOT of stuff.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Sun Jul 07, 2013 8:22 pm |
|
 |
Jkiss427
Rookie
Joined: Sun Jul 07, 2013 11:48 am Posts: 11
|
 Re: Virtual Worlds
No. I put the moving forward code in. And when I try to compile and download. It gives me error messages on those lines only. (That was the only code I could put. I'm right now on the mobile app)
|
Sun Jul 07, 2013 8:25 pm |
|
 |
NeXT-Generation
Senior Roboticist
Joined: Wed Sep 28, 2011 10:13 pm Posts: 630 Location: If I told you, I'd have to kill you.
|
 Re: Virtual Worlds
Well as soon as you can, past in the whole code. Everything. The entirety of the file. Heck, upload the file if you feel like it. It's probably a formatting error or something, but we need to see the whole program to be of any use.
_________________A.K.A. inxt-generation Self-proclaimed genius, and future world dominator. My Brickshelf Folder"Don't they teach recreational mathematics anymore?" - The Tenth Doctor Bow down to Nikola Tesla, King of the Geek Gods.
|
Sun Jul 07, 2013 8:29 pm |
|
 |
Jkiss427
Rookie
Joined: Sun Jul 07, 2013 11:48 am Posts: 11
|
 Re: Virtual Worlds
This is what comes up. (this is not a code)
**Error**:Executable statements not valid in 'main' declaration block **Error**:Executable statements not valid in 'main' declaration block **Error**:Unexpected '}' during parsing
|
Sun Jul 07, 2013 8:37 pm |
|
 |
rcahoon
Site Admin
Joined: Tue Oct 09, 2012 10:34 am Posts: 192
|
 Re: Virtual Worlds
In general, the C language doesn't care about line breaks, and instead uses semicolons to mark the end of statements. We put in line breaks when we write code to make it easier for us and other programmers to read, but many C programs could technically be written on a single line.
Thus, if you have a missing bit of syntax on one line, the ROBOTC compiler will continue on to the next lines until it reaches something that definitely tells it that it's not going to be able to make sense of the program, and only then will it report the syntax error.
tl;dr if you get a syntax error but can't find anything wrong with that line, try looking at the preceding lines. This is also why we need you to post the code for your entire program in order to help you find the problem.
Cheers, --Ryan
_________________ Ryan Cahoon CMU Robotics Academy RVW Software Developer
Robot Potato Head; Virtual NXT
|
Sun Jul 07, 2013 8:37 pm |
|
 |
Jkiss427
Rookie
Joined: Sun Jul 07, 2013 11:48 am Posts: 11
|
 Re: Virtual Worlds
I'm sorry but I don't understand that. I'm only a beginner. This is my first year with RobotC.
|
Sun Jul 07, 2013 8:40 pm |
|
 |
rcahoon
Site Admin
Joined: Tue Oct 09, 2012 10:34 am Posts: 192
|
 Re: Virtual Worlds
As simple as I can make it: if ROBOTC says you have a problem on one line, sometimes the problem may actually be somewhere else in the program.We'll be happy to help you find the problem if you post in your entire program. Instructions: Go to ROBOTC, select all your code (press Control-A if you want the shortcut). Select Edit>>Copy from the menu. Come back to this forum thread, click the Post Reply button. Paste the code into the reply box by pressing Control-V (Cmd-V on Apple computers). Select all the code you just pasted into the reply box. Click the Code button that's just above the reply box (this will add [code][/code] tags to format the code nicely so we can read it more easily). Press the Submit button. Best, --Ryan
_________________ Ryan Cahoon CMU Robotics Academy RVW Software Developer
Robot Potato Head; Virtual NXT
|
Sun Jul 07, 2013 8:59 pm |
|
 |
Jkiss427
Rookie
Joined: Sun Jul 07, 2013 11:48 am Posts: 11
|
 Re: Virtual Worlds
For some reason I forgot a semicolon, I put that in and it works!  Thanks anyway.
|
Sun Jul 07, 2013 9:01 pm |
|
 |
rcahoon
Site Admin
Joined: Tue Oct 09, 2012 10:34 am Posts: 192
|
 Re: Virtual Worlds
Cool! Glad you got it figured out.
_________________ Ryan Cahoon CMU Robotics Academy RVW Software Developer
Robot Potato Head; Virtual NXT
|
Sun Jul 07, 2013 9:28 pm |
|
 |
parkway
Moderator
Joined: Mon Oct 04, 2010 2:18 pm Posts: 196
|
 Re: Virtual Worlds
There you go. Remember, most compiler errors (red X's) are due to syntax errors. Missing semicolons and incorrect capitalization being two of the bigger culprits.
|
Sun Jul 07, 2013 10:15 pm |
|
|