Even though my example above doesn’t look it makes sense but I can say this is real code I use in my POS system and it is the most important logic to control the sales flow. I call the variable ActionStep. In one point, I need to check what value of this variable and what mode is enabled then enable/disable the user to take next action. For example, once payment is activated, user cannot input item code to search. The input must be the amount with 2 decimals value. It also determines how the Enter button behaves.