# How to use the output we see of expression when this expression is inside Dynamic

Consider this example:

Manipulate[status = Dynamic[If[a < b, Yes, No]], {a, 2}, {b, 5}]


The output of this calculation is

(*Yes*)


when I call status again I get Yes as expected.

No when I want to used the output of status in further calculation I failed. I tried to do the following:

status === Yes


the results is False

The full form of status is not what is seen in the output.

My question is, how to use the output of expression no matter what the definition of that expression is.

(Note: status[[1]] does not help because the level of the output is unpredictable)

Thank you.

• Take a look at Setting. Moreover, first argument of Manipulate is effectively wrapped in Dynamic so the one in your code is only making problems with it's head and gives nothing. – Kuba Aug 22 '14 at 4:55

(status /. Dynamic -> Identity) === Yes

If you want the value of status outside of the Manipulate to be updated whenever it changes inside the Manipulate, just drop the explicitDynamic.
 Manipulate[status = If[a < b, Yes, No], {a, 2}, {b, 5}]

The Manipulate will still work as it did before the change, and the second expression will track the changed to status` made inside the 1st.