Really silly question but this feels untidy to me and I’d like the opinion of others.
I have a few do loops where the original coder has used goto statements to jump out where necessary; such as this…
do j = 1, 9 [do something here] if <some condition> goto 20 end do 20 continue [more code]
Obviously I want to remove these goto statements so do I either do a minimal change…
do j = 1, 9 [do something here] if <some condition> j = 99 end do [more code]
Or should I restructure the whole loop?
j = 1 do while j < 10 [do something here] j = j + 1 if <some condition> j = 99 end do [more code]
I feel the latter is neater but would just appreciate the thoughts of others (in case my thinking is wrong).