I almost used goto in one of my clocks tonight. I needed to turn the display off while setting (to comply with NIST Special Publication 960-14 (WWVB Radio Controlled Clocks), and to make the code run faster, thus causing less interference with the radio software. I wanted to just turn the time display off while setting. So I tried just adding:
where skipOLED: was used in the sketch at another location. I got an error that said:
label 'skipOLED' used but not defined 'skipOLED' was not declared in this scope
I looked at my copy of K&R, and decided I didn't want to learn about it, so I opted to use a bit more code and add a couple lines:
which accomplished the same thing.
I'll show all my code and my schematic if you want to see them, but my actual question is more philosophy:
Have you ever used goto in a sketch? If so, why?