Thanks all. I didn't mean to stir up a big conversation.
The code is looking through a big matrix. In the real code it is 4 dimensional so there are 4 levels of nested loop in the search structure. When I find the first match I leave and I want to know the "coordinates" of the match I found (so the missile lands on target
) or that all of the iterators are at their maximum value so no match was found. I had thought of the solution in Pauls first response and it seemed logical but bulky. There is more code after the conditional so I'd have to set the boolean and then call break to break the innermost loop. That sounds easy enough.
I was just wondering if I had found the elusive "one use" for the goto.