Writing:
CreateDialog[{TextCell["Enter number: "],
InputField[Dynamic[nm], Number],
DefaultButton[DialogReturn[ret = nm]]}];
ConstantArray[0, nm];
I get:
ConstantArray::ilsmn: Single or list of non-negative machine-sized integers expected at position 2 of ConstantArray[0,1].
and I do not know how to correct. Some idea? Thank you!
ConstantArray[0, ToExpression@nm]
or modify yourInputField[...]
toInputField[Dynamic[nm], Number]
? $\endgroup$