home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a013 / 1.ddi / SOURCE.EXE / F_COMPUT.PRG < prev    next >
Encoding:
Text File  |  1991-01-25  |  821 b   |  29 lines

  1. *****************************************************************
  2. FUNCTION COMPUTE (compexpr, line, col, pictexpr, userfunc, ;
  3.                   new_color)
  4. *****************************************************************
  5.  
  6. * Displays on-screen computations during data entry
  7.  
  8. * Copyright(c) 1991 -- James Occhiogrosso
  9.  
  10. LOCAL old_color := IF(PCOUNT()=6,SETCOLOR(new_color),SETCOLOR())
  11. LOCAL ret_logic := .T.
  12.  
  13. * Display data with passed picture expression
  14. @ line, col SAY compexpr PICTURE pictexpr
  15.  
  16. * If a user function was passed, execute it
  17. IF PCOUNT() > 4 .AND. .NOT. EMPTY(userfunc)
  18.     ret_logic := &userfunc(ret_logic)
  19. ENDIF
  20.  
  21. * If the UDF returns with an error, clear computation area
  22. IF .NOT. ret_logic
  23.      @ line, col SAY 0 PICTURE pictexpr
  24. ENDIF
  25.  
  26. SETCOLOR(old_color)
  27. RETURN ret_logic
  28.  
  29.