Navigation:  Reference > Functions >

ValidCheck()

Print this Topic Previous pageReturn to chapter overviewNext page

 

VALID_CHECK()

 

PURPOSE

This function will evaluate any ValidExpr properties in all of the objects on the current screen form.

 

NO OTHER PARTS

 

RETURN TYPE - L

If any ValidExpr evaluates to False this function will return False, otherwise it will return True.

 

COMMENTS

During the check process the program will scan through the current active screen for any object that has a ValidExpr property that is not blank.  When it finds one it resolves the expression.  If the expression returns True it continues on to the next object until all have been tested.  If the expression evaluates to False it exits the test and returns False to this function.  In normal process you would exit the subroutine you're running and allow the user to fix the problem.

 

It doesn't matter how many ValidExpr's there are in the screen form.  It will continue to check each one until they all return True.  This feature allows you to add or remove checks without having to worry about changing your code.  You do have to remember to recompile the program to include (or remove) valid expressions.

 

NOTE:  If you want to check the ValidExpr's in a TTASDataGrid you must use the GRID_VALID_CHECK() function instead of this.

 

EXAMPLE

In the tutorial that is part of TAS Professional an example is provided of this process.  The ValidExpr for the Order Number is: SONumber<>0.  The VALID_CHECK() function is part of the save routine and is as follows:

 

navSO.save:

if .not. valid_check() then ret false

 custcode = socustcode

save @cust_hndl nocnf

ret true

 

If the VALID_CHECK() function returns False the save subroutine returns False also and neither the SALES or CUSTOMER record is saved.

 


Page url: http://www.cassoftware.com/tas/manual/validcheck().htm