Branch Command


The Branch Command Action can be used to change the execution of your script based on an expression or the value of a control. Note that this action references an open form or browse.


  1. On the first page of the Script Genie select a value from the Branch Expression is based on list.

  2. If you selected "The Value in a Control on the current Form or Browse", choose a control from the Control Name list.

  3. In the Branch Choices text box enter a list of choices, separated by line breaks.

  4. Check the Include a default branch check box if you want to have default branch if the expression does not evaluate to any of your choices.

  5. Click Next >.

  6. Enter a unique name for the branch test in the Branch Name field.

    For each choice, specify whether you want to play a script or set a variable to TRUE (.T.). By default, the Action is to set a variable to true. The variable name is a combination of the branch name and the option name. For example, if the branch is branch1 and the choice is New York, the variable will be called branch1_new_york and it will be set to .T. (TRUE). To play a script when a choice is TRUE, you must also specify the name of the script.
  7. For each entry in the If the expression evaluates to list select a value in the then ... list.

  8. If you selected Include a default branch on the previous page of the genie, in the Default Action field specify what you would like to happen for the default branch. If a variable is set to TRUE, it will be called, branchname_else where branchname is the name of your branch.

  9. Click Next >.

  10. On the next page of the Script Genie optionally modify the default comment which describes the action.

  11. Click Finish.

See Also