Topic: Again about unconditional jumps
I again have a choice, whether to use unconditional jumps in the code. There is a code location in which preparation for a cycle, then a cycle, then cycle end is fulfilled at first. And in all these sections the program can define that it is time to quit a cycle and to finish performance of this code, but before it it is necessary to fulfill some actions (for example to release arrays and classes). I see three variants: 1) In places where it is revealed that it is necessary to finish procedure, there are some operators (identical). I so do often enough, and I put these operator in single line - personally it seems to me convenient. For example, so: If i> myarray.count-1 then begin myarray.free; exit; end; 2) to Use unconditional jump: If i> myarray.count-1 then goto 223;... 223: myarray.free; 3) to Create separate procedure, on output from which will be fulfilled : procedure Perform;... If i> myarray.count-1 then exit;... end;... begin perform; myarray.free; end; What variant to use more correctly?