For any beginner these are a must:
Because for your code as it is right now, with no additional definitions, those variables are symbols - you did not define them numerically (Dynamic
got nothing to do with it).
X1 // Head
Symbol
Now if you do this you'll get your 'Number':
{X1, X2, Y1, Y2, FK, MK, HK} = Range[7];
InputField[Dynamic[X1], Number, Alignment -> Center];
InputField[Dynamic[X2], Number, Alignment -> Center];
Slider[Dynamic[Y1], {0, 200, 1}];
Slider[Dynamic[Y2], {0, 200, 1}];
Dynamic[FK, Dynamic[X1*(1 + Y1/100)]];
Dynamic[MK, Dynamic[X2*(1 + Y2/100)]];
Dynamic[HK, Dynamic[FK + MK]];
HeadTest = NumberQ[#] & /@ {X1, X2, Y1, Y2, FK, MK, HK}
{True, True, True, True, True, True, True}
I am not sure what you trying to get, but generally the price of dynamic updating is change of Head
. Maybe this example will help to understand - turn your attention to what changes, what evaluates and what does not:
{Slider[Dynamic[x]], Dynamic[x], x, Dynamic[x] // Head, x // Head,
Sin[x], Sin[Dynamic@x], Dynamic@Sin[x]}
# &
) toMap
(/@
) an existing one:NumberQ[#] & /@
is not needed,NumberQ /@
will suffice. $\endgroup$