Conditionally execute an assignment

Top  Previous  Next

The condition

 

X$(y gt 0) = 10;

 

says set X=10 if the scalar y is greater than zero, while the condition

 

percentchange$(y ne 0)= 100*(x-y)/y;

 

says compute the item percentchange if y is not equal to zero.

For more on this class of conditionals see the discussion in the Conditionals chapter.