home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a012 / 1.ddi / CHAP27.EXE / CHP2703.PRG < prev    next >
Encoding:
Text File  |  1991-06-12  |  579 b   |  25 lines

  1. /*
  2.    Listing 27.3. A final version of Assert(), this one
  3.                  with the ability to reset the internal counter.
  4.    Author: Craig Yellick
  5.    Excerpted from "Clipper 5: A Developer's Guide"
  6.    Copyright (c) 1991 M&T Books
  7.                       501 Galveston Drive
  8.                       Redwood City, CA 94063-4728
  9.                       (415) 366-3600
  10. */
  11.  
  12. function Assert(expr)
  13. static counter := 0
  14.   if expr = nil
  15.     counter := 0
  16.   else
  17.     counter++
  18.     if .not. expr
  19.       break counter
  20.     endif
  21.   endif
  22. return nil
  23.  
  24. // end of file CHP2703.PRG
  25.