Radio buttons appear in radio clusters. The value of each radio button is either "1" for On or "0" for Off. The value of the radio cluster is the key attribute of the currently selected button. The PDB feature manages the values of radio buttons in a cluster and ensures that only one button is turned on at a time. You can assign an action to each radio button, but it is more convenient to assign an action to the radio cluster as a whole and then test the cluster's value to see which radio button was chosen.
Consider the following example: A radio cluster controls the view of a three-dimensional object that is displayed after a user exits a dialog box. This cluster contains four radio buttons:
(action_tile "view_sel" "(pick_view $value)")
.
.
.
(defun pick_view (which)
(cond
((= which "front") (setq show_which 0))
((= which "top") (setq show_which 1))
((= which "left") (setq show_which 2))
((= which "right") (setq show_which 3))
)
)
These examples show each radio button associated with a single variable that takes multiple values. These variables may also cause additional actions, such as disabling selections in your dialog box. If the radio cluster is large, you can store the associated values in a table. If you use a table, structure it so it doesn't depend on the order of the buttons within the cluster. The PDB feature does not impose this restriction, and the order can change if the DCL definition changes.