What is the default value of the numeric entry box?

Apr 26, 2023

Hi All, 

I worked a lot recently with the numeric entry boxes, and I have the following wonders and thoughts: 

- The default value of the numeric entry variable is zero, according to the variables list. 

- The shown entry box, when inserted, is a blank entry box. 

blank entrybox

- I would like to make an action if the user did not enter anything in the box. Suppose that I want to change the state of a rectangle from hidden to normal, if the user enters any non-zero value. 

- If I made a condition that: show the rectangle if the entrybox does not equal zero, the action will happen even if the user left this blank, without entering anything! 

- Does this mean that the default value is blank? This is not the case in the default values of the variables! 

Default values

Can anyone resolve this confusion? What should I do alternatively in this case? 

 

Thank you

 

1 Reply
Jose Tansengco

Hello Ahmed, 

Thanks for reaching out! 

One way to prevent states from triggering when nothing is entered in a numeric entry box is to associate a trigger with the 'when variable changes' event, similar to what is shown in this screenshot: 

This will make it so that an action will only occur if a valid number is entered in a numeric entry box. I've attached a sample project file to demonstrate this behavior. 

Let me know if you have any questions!