ooPIC Logo

Unconditional Branch

Main Index
Language Idx
Back to top of pageDescription:
 A flow control statement that branches unconditionally to a specified line.
Back to top of pageSyntax:
 The following shows the format of the Unconditional Branch syntax.
Visual Basic & BASICCJava
Goto <line>
Goto <line>;
The Java syntax does not support the Unconditional Branch

The following table lists the elements of the Unconditional Branch syntax.
ElementDescription
Basic & CJava
<line> Used to specify the target line label that will be branched to.

Back to top of pageOperation:
 Basic & C Syntax:
When an Unconditional Branch is encountered during the program's execution, the program flow will branch to the target line label specified by the <line> element. The only stipulation on the Unconditional Branch is that the target line label be within the same Function or Procedure that the Unconditional Branch is in.

Java Syntax:
Java only allows structured flow-control statements to be used and therefore does not support the Unconditional Branch.

Back to top of pageRemarks:
 The Unconditional Branch allow programs to be written in unstructured ways. This can create code that is hard to debug. It is recommended that other flow-control statements be used instead.
As a point of order, the entire ooPIC compiler program does not contain one single Unconditional Branch.
Back to top of pageExample:
 In the following example, an Unconditional Branch is shown that causes the program flow to branch to the line labeled "LLL" where the statements in <statement2> are executed.. As a result, the statements in <statements1> are never executed.
Visual Basic & BASICCJava
  Goto LLL
  <statements1>
LLL:
  <statements2>
  Goto LLL;
  <statements1>
LLL:
  <statements2>
Not possible.

Back to top of pageRelated Items:

 For information on line labels, see the section on Control Structures in Chapter 4 of the ooPIC Programmers Guide.: Programming Fundamentals
Back to top of pageVersion History and Bug List:
 Firmware Ver A1: Introduced.

Bugs: No known bugs.


 

ooPIC Compiler Ver 6.0 (c) Copyright 1997 - 2007 Savage Innovations, LLC.