home *** CD-ROM | disk | FTP | other *** search
- *****************************************************************
- FUNCTION COMPUTE (compexpr, line, col, pictexpr, userfunc, ;
- new_color)
- *****************************************************************
-
- * Displays on-screen computations during data entry
-
- * Copyright(c) 1991 -- James Occhiogrosso
-
- LOCAL old_color := IF(PCOUNT()=6,SETCOLOR(new_color),SETCOLOR())
- LOCAL ret_logic := .T.
-
- * Display data with passed picture expression
- @ line, col SAY compexpr PICTURE pictexpr
-
- * If a user function was passed, execute it
- IF PCOUNT() > 4 .AND. .NOT. EMPTY(userfunc)
- ret_logic := &userfunc(ret_logic)
- ENDIF
-
- * If the UDF returns with an error, clear computation area
- IF .NOT. ret_logic
- @ line, col SAY 0 PICTURE pictexpr
- ENDIF
-
- SETCOLOR(old_color)
- RETURN ret_logic
-
-