14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 9 Data Tables 293<br />

Row State Operators<br />

To access just a component of a row state, place the row state expression on the right side of an assignment<br />

and also use one of the L-value operators:<br />

Set Row States<br />

x = selected(rowState()); // selection index of current row selected<br />

To set a row state, place the row state expression on the left of an assignment (L-value):<br />

row state() = expression;<br />

row state(i) = expression;<br />

To set a component of a row state,<br />

ColorOf(row state(i)) = 3;<br />

Selected(RowState(i)) = 1;<br />

// for the current row<br />

// for a specified row<br />

// change color to red for row i<br />

// select the ith row<br />

Note: As seen above, some of the operators convert numbers into states, and others<br />

convert states into numbers. Here are hints for remembering which are which:<br />

Number-to-state operators have the word “State” The operators that take<br />

number arguments and either return states or accept state assignments all have the<br />

word “State” in their names: Row State, As Row State, Color State,<br />

Combine States, Excluded State, Hidden State, Hue State, Labeled<br />

State, Marker State, Selected State, Shade State.<br />

State-to-number operators are one word or have the word “Of” The operators<br />

that take row state arguments (and assume that the argument Row State() if none<br />

is given) and return or get set to numbers are either one word or their second word<br />

is “Of”: Color Of, Excluded, Hidden, Labeled, Marker Of, Selected.<br />

Table 9.4 on page 294, is a helpful comparison chart for these operators.<br />

The following lines are equivalent to their interactive commands.<br />

Copy From Row States<br />

Add From Row States<br />

Copy To Row States<br />

Add To Row States<br />

Set Row State Combinations<br />

Use Combine States to put together the settings of the various States:<br />

x = CombineStates(SelectedState(1),LabeledState(0),ColorState(3));<br />

for each row(rowstate()=x);<br />

Create Row State Columns<br />

To create a row state directly in a column, use a formula:<br />

dt

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!