3 ms·
> break out of nested loops -deeply- nested loops at that. I once was on a thread in a forum discussing state machines, and somewhere in the convo the use of
by cr0sh 8y ago
> break out of nested loops
-deeply- nested loops at that.
I once was on a thread in a forum discussing state machines, and somewhere in the convo the use of GOTO popped up. I wasn't for it, but somebody made mention of how it could be used to implement a state machine very compactly.
Then he showed his code - it was done in PBASIC. I saved a copy of that code, because it was very, very elegant. While I knew there were certain very niche cases for GOTO, I never thought that a state machine would qualify. For me, it does now.
I don't have the code handy, but it reminded me of Duff's device, if you know what that is - just done in BASIC - and not as a SWITCH-CASE of course...