Specifying a Default Case

Specify a default case for the Case structure to handle out-of-range values. Otherwise, you must explicitly list every possible input value. For example, if the selector is an integer and you specify cases for 1, 2, and 3, you must specify a default case to execute if the input value is 4 or any other valid integer value.

Complete the following steps to specify a default case.

  1. Move to the case you want to make default and click on the case selector label with the Labeling tool.
  2. Enter Default in the selector label.
    Note  Do not add quotation marks around Default. Doing so indicates that the value is a string, rather than the default case.
  3. Press the <Enter> key.

    Macintosh and UNIX Press the <Return> key.

You also can move to an existing case, right-click the case selector label, and select Make This The Default Case from the shortcut menu to make an existing case the default case.