Go Down

Topic: goto statement (Read 4384 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