What is the semicolumn in the console?

Posted on
  • Hi,

    Sometimes, when I load the code to esp8266, there is ":" prompt waiting for input and nothing (like Enter) cancels it.

    What is that?

  • Mismatched parens/braces?

    I think that's the prompt it shows when a function/etc has been continued onto the next line because there's an open paren/etc?

  • Try Ctrl + C to cancel it.

    How are you loading code up? If you're using the right-hand side and clicking 'upload' then it shouldn't happen.

    The : happens when you have entered a multi-line command, which you do my having more open brackets than close brackets.

    So if you type:

    function a() {}
    

    Then you get back to >

    But if you type the following:

    >function a() {
    :
    

    Then you have one open bracket and you get the : (as shown)

    To end the function, just add a closing bracket and hit enter:

    >function a() {
    :}
    =function () {}
    > 
    

    Of course if that doesn't work, it might be because you have more than one open bracket :)

  • Note that if you're sending code from the right hand side of the IDE, instead of copy/pasting into the left side, the minifier will complain if you have missing braces or other syntax errors.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

What is the semicolumn in the console?

Posted by Avatar for ceremcem @ceremcem

Actions