home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / COUNTER.CPP < prev    next >
C/C++ Source or Header  |  1997-01-16  |  1KB  |  26 lines

  1. //----------------------------------------------------------------------------
  2. //Borland C++ Builder
  3. //Copyright (c) 1987 Borland International Inc. All Rights Reserved.
  4. //----------------------------------------------------------------------------
  5. //-------------------------------------------------------------------------
  6. //    counter.cpp - example of a small, non-visual counter component
  7. //-------------------------------------------------------------------------
  8. #include "counter.h"
  9. //-------------------------------------------------------------------------
  10. TCounter::TCounter(int Multiple)
  11. {
  12.   FMultiple = Multiple;
  13. }
  14. //-------------------------------------------------------------------------
  15. void TCounter::Clear()
  16. {
  17.   FVal = 0;
  18. }
  19. //-------------------------------------------------------------------------
  20. void TCounter::Increment()
  21. {
  22.   if (((++FVal) % FMultiple) == 0)
  23.       OnMultiple(this);
  24. }
  25. //-------------------------------------------------------------------------
  26.