How can i make in this code the text in Dialog Box of the Input command to be like this "Enter the 1 element","Enter the 2 element"....
For[k = 1, k ≤ n, k++,
br = Input["Enter the ",i,"element"];
AppendTo[x, br];
]
How can i make in this code the text in Dialog Box of the Input command to be like this "Enter the 1 element","Enter the 2 element"....
For[k = 1, k ≤ n, k++,
br = Input["Enter the ",i,"element"];
AppendTo[x, br];
]
Make sure your variables match. :-)
You can use
Row
to build up the text.(You could also use
StringJoin["Enter the ", ToString[k], " element"]
, but I likeRow
better.)According to the Input[ ] help:
So, anything will fit in the input prompt!
Just as an example (note the explicit loop is not needed):
Will show things like: