Go Down

Topic: goto statement (Read 4207 times) previous topic - next topic


excuse me

arduino reference states I can jump to a label using the GOTO statement

I try:
Code: [Select]
for(byte r = 0; r < 255; r++){
   for(byte g = 255; g > -1; g--){
       for(byte b = 0; b < 255; b++){
           if (analogRead(0) > 250){ goto bailout;}
           // more statements ...

but I give this error

In function 'void loop()':
error: expected primary-expression before '}' token

Using "Arduino - 0012 Alpha"

what is the problem??????? :-?


i have found the solution
after a label there must be a statement of any sort....
to close curly bracket directly after label: in not accepted

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