Previous Page | Next Page

SAS Component Language Dictionary

ACTIVATE



Activates or grays either a Version 6 check box or radio box widget, or a station in a choice group
Category: Control or Field

Syntax
Details
Examples
Example 1: Activating a Radio Box Station
Example 2: Activating a Station in an Extended Table
See Also

Syntax

rc=ACTIVATE(var-name,station<,row>);

rc

contains the return code for the operation:

0

successful

[ne]0

not successful

Type: Numeric

var-name

is the FRAME entry control or choice group to activate.

Type: Character

station

is the number of the station or item to be activated or grayed:

>0

is the number of the station to be activated.

<0

is the number of the station designated by the absolute value of the argument to be grayed instead of activated. Users cannot select a station that has been grayed.

0

indicates that no station is to be activated.

Type: Numeric

row

is the row number for a choice group that is in the scrollable section of an extended table. Row is valid for PROGRAM entries but not for FRAME entries. Specify row only when you want to activate a station from outside an extended table's getrow or putrow section. Do not specify row if you want to activate a station with the _getrow or _putrow method or from the getrow or putrow sections.

Type: Numeric


Details

ACTIVATE works only for Version 6 widgets in FRAME entries and for choice groups in PROGRAM entries. Version 8 and later SCOM controls use attribute settings to implement this functionality. ACTIVATE is not valid in FSEDIT or FSVIEW programs.

The station value is the number of the check box or the item or button in a check box or choice group. For example, if your application has three fields named A, B, and C, and they all belong to the same radio box, then you can make the B field active by passing 2 for the station value (B is the second field).

ACTIVATE makes a check box or an item in a radio box or choice group active by assigning the station or item number to the associated window variable. ACTIVATE grays a check box or an item in a radio box or choice group when you assign the negative number of the station or item. When a window element is grayed, users cannot select it.

FRAME entry controls can also use the _activate method.

For linked action fields in choice groups, the action-type pair is considered one station. Linked action fields have the following form:

& &A_____   & &B_____    & &C_____

To make the linked action pair for B active, pass 2 for the value of station, not 4.


Examples


Example 1: Activating a Radio Box Station

Activate the second station in the radio box HOBBY:

rc=activate('hobby',2);


Example 2: Activating a Station in an Extended Table

Make the third station in the fourth row of an extended table the active station in the choice group LIST:

if (activate('list',3,4)) then
   do;
  ...SCL statements to handle the error condition...
   end;


See Also

GRAY

ISACTIVE

ISGRAY

UNGRAY

Previous Page | Next Page | Top of Page