How to use a edit box on a GUI
3 views (last 30 days)
I am trying to use a edit box to be able to put a number in the box and then use a push button and it will take that number and use it. I am doing this for a robot maze and im trying to write a number of steps in the edit box and the when i push the button it takes that many steps in the maze. I'm suppose to use the a function that has already been created 'walk' to do this but i have no idea how to.
function steps_made_successfully = walk(number_of_steps)
steps_made_successfully = 0;
if is_clear()steps_made_successfully = steps_made_successfully + 1;
Kevin Holly on 1 Dec 2022
Add a callback to the ninth_button that reads the value in the 'eighth_button' edit field and places it as an input to the walk function.
ninth_button.Callback = 'number_of_steps = str2num(eighth_button.String); walk(number_of_steps)';