BRANCHF Examples


Example 1:

 

  

BRANCHF

FKEY1,FKEY2,FKEY3,FKEY4,FKEY5:

  

  

FKEY6,FKEY7,FKEY8,FKEY9,FKEY10

 

If Function Flag F1 was set (TRUE due to Function key 1 being pressed), execution would shift to Program Execution Label FKEY1. If Function key 2 were pressed, execution would shift to FKEY2 and so on. Pressing a Function key greater than the number of Program Execution Labels results in the program falling through the BRANCHF routine to the next sequential instruction.

 

Example 2:

 

  

BRANCHF

FKEY1,,,,FKEY5:

  

  

FKEY6,,,,FKEY10

 

If Function Flag F1 was set (TRUE due to Function key 1 being pressed), execution would shift to Program Execution Label FKEY1. If Function key 2 were pressed, execution would continue with the next instruction since there is no corresponding label for the second function key. Pressing a Function key greater than the number of Program Execution Labels results in the program falling through the BRANCHF routine to the next sequential instruction.

 

 



PL/B Language Reference BRANCH Examples BREAK Examples