Go Down

Topic: break (Read 442 times) previous topic - next topic


part of code

void rec_tab(){
  byte i=0,chk=0,j=0;
    if (Serial.available()>0){
      in_buff[j] = Serial.read();
      if (j==in_buff[1]+2) break;

  lcd.print("  after break ");

Why break clear chk ??
Before break LCD display 0xA3  after break 0x00 ??


Have you tried posting down the street at snippets-r-us.com? Here, we get to see ALL of your code, posted using the code icon (with the #), not the quote icon.


break isn't clearing chk, your code is changing it.  break exits the innermost enclosing loop or switch statement with immediate effect.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]


break does not break out of "ifs", only loops. Your break leaves the while loop.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131