Navigation:  Reference > Form Objects > Common Properties >

ValidCheckOnExit

Print this Topic Previous pageReturn to chapter overviewNext page

 

If you check this option, and you have a ValidExpr for this entry field, the ValidExpr will be evaluated when the user exits the field, for any reason.  This includes moving to a different field, clicking on a button, etc.  If the ValidExpr returns .False. the user will not be allowed to leave the field until the expression returns .True.

 

Use of this option allows you to tightly control what the user can, or cannot enter.  However, there is a downside to this.  If the user just wants to exit the program all together by clicking on an Exit button that you provide, and the ValidExpr returns .False., they won't be allowed to exit.  The solution to this is the following:  In the KeyTraps property add an ESC trap.  The Gosub label should probably point to an exit routine (one that includes the command QUIT), however, it isn't required.  You could have a SET_FOCUS command that puts the cursor in another field.  When the user presses the ESC key the program will check for the ESC Trap, and, when it finds it, will ignore the ValidExpr and will execute the trap.  This will allow your user to always escape from a ValidExpr, even if it is just to exit the program.

 

 


Page url: http://www.cassoftware.com/tas/manual/validcheckonexit.htm