home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / COUNTER.CPP < prev    next >
C/C++ Source or Header  |  1997-02-28  |  1KB  |  26 lines

  1. //----------------------------------------------------------------------------
  2. //Borland C++Builder
  3. //Copyright (c) 1987, 1997 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.