This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TOGGLE.C(10): error C141: syntax error near '}'

i am facing error C141: syntax error near '}'

my program is given below:

#include<reg51.h>
void main ( )
{ int x; while (1) { P1 = 0x00 ; for (x=0 ; x<=5000 ; x++) P1 = 0xFF ; for (x=0 ; x<=5000 ; x++) } }

any one can help me how to solve it

Parents
  • That might even have been a valid argument, were it not for the fact that what is shown here was shown on the OP's screen first. That's exactly what the preview-before-post mechanism was created for.

    So the OP did see that the formatting was shot, and decided to post it as broken as it was.

    Lesson learned: before you blame others, try to get your facts straight.

    The op might not of seen what you think chum.

    You do not always see the full preview of what your going to post with the preview-before-post mechanism. Just try entering some text, previewing, then entering more text. Now the post button is visible and enabled. So the op could of entered his text, then previewed, then pasted in his code and posted without seeing how bad it looked.

    Lesson learned: before you state what you think is a certainty, try to get your facts straight.

Reply
  • That might even have been a valid argument, were it not for the fact that what is shown here was shown on the OP's screen first. That's exactly what the preview-before-post mechanism was created for.

    So the OP did see that the formatting was shot, and decided to post it as broken as it was.

    Lesson learned: before you blame others, try to get your facts straight.

    The op might not of seen what you think chum.

    You do not always see the full preview of what your going to post with the preview-before-post mechanism. Just try entering some text, previewing, then entering more text. Now the post button is visible and enabled. So the op could of entered his text, then previewed, then pasted in his code and posted without seeing how bad it looked.

    Lesson learned: before you state what you think is a certainty, try to get your facts straight.

Children
  • You do not always see the full preview of what your going to post with the preview-before-post mechanism. Just try entering some text, previewing, then entering more text. Now the post button is visible and enabled. So the op could of entered his text, then previewed, then pasted in his code and posted without seeing how bad it looked.

    what hinders anyone from clicking 'preview' even when not forced to?
    do you consider 'preview' an annoyance?

    Erik

  • Erik,

    I have a really straight forward question. Do you think anyone that makes a mistake should be blasted for making a mistake?

  • do you consider 'preview' an annoyance?

    I don't. Do you think that what I said implied that I do? I just pointed out that the reasoning of Hans-Bernhard Broeker is floored when he insisted that the op did see the formatting when, really, he might not of.

  • "Do you think anyone that makes a mistake should be blasted for making a mistake?"

    Read my first answer in this thread. Was the OP blasted?

  • Ok, blasted might be an extreme word. But it's a straight forward question. Basically, does he (or you, if you take issue with the question) think people who make mistakes deserve any grace or should they immediately be berated for making a (easy enough) mistake? I'm just trying to make a point that there's a difference between laziness and making a mistake. If you believe that people who make mistakes should be given no grace and should be treated as if they're lazy, fair enough. If you differentiate between the two, that's fine too. I was just curious and just wanted a straight answer.

  • Well - my post did contain the text:

    "But why can you not use the correct formatting so we get to see a properly intended source code? Didn't you check the information directly above the message input box?"

    Then I did give the pertinent information to the problem with the code.

    So should we not point out the issue with formatting, when the code in question have an error that do relate specifically to scoping rules - something that indentation rules was created to better highlight?

  • Forget that for now, I think we've beat that horse into the ground. What I'm trying to understand is the perception of how people post here (not you so much, I'm actually more interested in hearing Erik's reply to this one), whether it's read as laziness regardless or if there's any consideration that a person could simply have made a mistake. It's a very, very specific, direct question. It's not difficult to answer. Answer it if you want or ignore it.

    Do you think people who make mistakes deserve any grace or should they immediately be berated for making a mistake when posting here, regardless of circumstances of the mistake?

    I'm not talking about in context to THIS situation (we've gone over it over and over). I'm talking about in general. Is the possibility of someone making a mistake even a factor in responses or should anyone who makes a mistake be treated as if they're just being lazy?

  • Heh, on a sidenote, it's pretty amusing that there are now 53 responses to a one line piece of code that was merely missing a semicolon . . . :)

  • No - I'm pretty sure the code missed two (2) semicolons.

  • whether it's read as laziness regardless or if there's any consideration that a person could simply have made a mistake. It's a very, very specific, direct question. It's not difficult to answer. Answer it if you want or ignore it.

    I really would not think of it as 'laziness' but more like "lack of interest in doing right". In todays society there is waaaaay too much of "if I do not do what I'm supposed to, so what, it is not politically correct to berate me"

    Erik

  • I just pointed out that the reasoning of Hans-Bernhard Broeker is floored

    Since we seem to be nitpicking anyway: I think you wanted to say "flawed" there, not "floored".

    when he insisted that the op did see the formatting when, really, he might not of.

    There is, indeed, a small probability that this might have been how this particular OP fell into this trap. But if you spend a little time to look at other threads in here, you'll see just how small that probability really is. There are just too many posts (including replies by OPs after they've seen the mess they made before and been told about the tags) consisting of nothing else but a single copy-pasted block of code to support the idea that this is anywhere near the typical mechanism this happens.

    Not to mention that even if they didn't preview again after the last big paste-in, the garbled version still shows on the OP's screen before it does on anyone else's, since the next thing the forum shows you after posting is the thread you posted into, with that garbled text in it. So that's yet another opportunity to notice your mistake, and at least rectify it by a follow-up with proper formatting --- but that gets ignored, too.

    So there really is no valid excuse like the one Trevor Morgan suggested. The OP does get to see the mess he made before anyone else does, so there's no "I didn't see that" defense.

  • I think you wanted to say "flawed" there, not "floored".

    That is correct. Did you also notice the other error of he might not of?

    The OP does get to see the mess he made before anyone else does, so there's no "I didn't see that" defense.

    That is almost certainly going to be the case. But, since there is no editing feature of a post made, there is little an OP could do about it. Apart from maybe add a corrected repost. There again, as we all know, OPs are frequently just good for nothing lazy slackers, so they are unlikely to repost and say sorry.

    But if you spend a little time to look at other threads in here, you'll see just how small that probability really is.

    Really? Maybe the frequency of occurence indicates otherwise.

    So there really is no valid excuse like the one Trevor Morgan suggested.

    Wait a moment there. Trevor Morgan actually wrote:

    So, your comments are really only appropriate to what is shown here and not what might be shown on the OPs computer screen.

    Is he talking about what the OP might be showing on his editor with the original program fragment or what he sees during the post of this forum? If it is the former, then it does not seem an reasonable statement.