Chapter Contents


SAS/AF Software: Class Dictionary

Using the Radio Box Control

Key properties to set
borderTitle attribute Specify the title for the radio box.

You can also query or set this attribute using SCL. For example, the following line of SCL code sets the title of the radio box to 'Values.'

radiobox1.borderTitle = 'Values';
selectedItem attribute (default attribute) Specify which item in the radio box will be selected by default.

You can also query this attribute to find out what the user has selected. For example, the following line of SCL code queries the item currently selected:

choice = radiobox1.selectedItem;

Note:   The following line of code is also valid since the selectedItem attribute is the default attribute:

choice = radiobox1;
To specify that no item in the radio box be selected, in the Properties window enter a blank space as the value for selectedItem. To achieve the same behavior by setting the attribute via SCL code, set the attribute to two single quotes ('').

Setting radio box items

You must tell every radio box control what items to display. Use one of the following ways to add items to a radio box control:

Build-time attributes

The following attribute is a build-time attribute, meaning it can only be set at build-time if you choose to use it:

Using SCL to specify radio box items

You can specify radio box items using an SCL program.

For example, the following code creates a list and assigns the list to a radio box control:

petList = makelist();
rc = insertc(petList, 'Dog', -1);
rc = insertc(petList, 'Cat', -1);
rc = insertc(petList, 'Bird', -1);
radiobox1.items = petList;

You could just as easily fill a radio box control with a list of items that already exists in a model that you have instantiated. The following code assigns color list model items to a radio box control:

radiobox1.items = colorlist1.items;

Chapter Contents



Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.