Goto Statement

Definition:

  • A goto statement is used. The use of goto statements is inadvisable and should be avoided.

Code Example:

function f ( integer i ) runs on ExampleComponent {
  var integer MyVar := i ;
  label L1 ;
  MyVar := 2 ∗ MyVar ;
  if (MyVar < 2000) {
    goto L1 ;
  }
  MyVar2 := f2(MyVar);
  if (MyVar2 > MyVar) {
    goto L2 ;
  }
  p.send(MyVar);
  p.receive -> value MyVar2;
  label L2 ;
}

References:

Quality attributes

  • - Code Example

  • - Cause and Effect

  • - Frequency

  • - Refactoring