This question grew out of this other one: DynamicModule not working when additional code is included.
Let's start with this simple code:
colour = "red";
Panel[
Column[{
InputField[colour, String],
Do[
n1 = 4,
{i, 1, 3}
],
InputField[colour, String]
}]
]
The output is the following:
The Do loop returns a Null, which shows up as a blank space between the two text boxes. Now use DeleteCases to get rid of the Null:
colour = "red";
Panel[
Column[
DeleteCases[
{
InputField[colour, String],
Do[
n1 = 4,
{i, 1, 3}
],
InputField[colour, String]
}, Null]
]
]
And the output is now without the Null:
Now add a Dynamic (which I need for the other question I referred to), as follows:
colour = "red";
Panel[
Column[
DeleteCases[
{
InputField[colour, String],
Dynamic[Do[
n1 = 4,
{i, 1, 3}
]],
InputField[colour, String]
}, Null]
]
]
And here is the output:
In other words, Dynamic seems to be shielding from the action of DeleteCases. Is there any way to get rid of the Null in the output in this third case?
Many thanks.
Do
loop in aColumn
? p.s. the reason why is: mathematica.stackexchange.com/questions/5817/… $\endgroup$