## Branching by Using Flow Control: Introduction

Suppose you have a part with many features, but you just want to measure a few features over and over to get a comprehensive statistical set of data for those features. Suppose you want to jump to a particular part in your part program dependent on a response from the user. You can accomplish tasks such as these, and many others, by using flow control commands. By setting up conditions for certain commands, you can control the flow of your part program.

This section will provide you with the information you need to accomplish such tasks. It explains the syntax conditional statements, loops, and subroutines. It also provides many code samples.

Note: When looping or branching occurs in the code samples, indentation has been used for clarity to show statements assigned to a certain condition. In the actual Edit window code, you won't see any indentation.

The main topics covered in this section include the following:

- Using Control Pairs

- Creating Generic Loops

- Ending Generic Loops

- Creating Labels

- Jumping to a Label

- Jumping to a Label Based on Conditions

- Branching on a CMM Error

- Branching with Subroutines

- Ending a Part Program