Progress
Programming
Handbook
Example Procedures
The following example defines an integer variable, pay–stat, that can have a value of 1, 2, or 3. It prompts the user to update the variable by displaying it as a radio set. It then redisplays the variable as a fill-in.
By viewing the variable as a radio set, the user is constrained to selecting one and only one of the meaningful values for the variable. Since each integer value represents a different state for an outstanding invoice, the procedure defines meaningful labels that describe these states and displays these in each button, rather than displaying the integer values:
NOTE: When you view a field or variable as a radio set, if it is not set to a valid value, it defaults to the first radio button. In the example, pay–stat is explicitly initialized to 1.When you run this procedure, because pay–stat is initialized to 1, the first radio button is initially chosen. You can either accept that value or choose another button. When you press
GO
, the value is assigned to pay–stat and then viewed as a text widget.For example, if you select the second radio button and press
GO
, the screen appears as follows:
![]()
Note that when you select the second button, the first button is automatically deselected.
As with toggle boxes, you can also use the VALUE–CHANGED event with a radio set. This gives the user instant feedback when a new radio button is chosen, as in the following example:
When you run this procedure, the description message changes immediately each time you choose a different radio button.
For example, if you select the second radio button, the screen appears as follows:
![]()
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |