home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / MINICOMP.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-24  |  929 b   |  31 lines

  1. //-------------------------------------------------------------------------
  2. //    minicomp.cpp - uses the TCounter example component
  3. //-------------------------------------------------------------------------
  4. #include "minicomp.h"
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7. //-------------------------------------------------------------------------
  8. main()
  9. {
  10.   TExample example;
  11.  
  12.   return 0;
  13. }
  14. //-------------------------------------------------------------------------
  15. TExample::TExample()
  16. {
  17.   TCounter Counter(7);
  18.   int i;
  19.  
  20.   Counter.OnMultiple = MultipleReached;
  21.  
  22.   for (i=0; i < 100; i++)
  23.     Counter.Increment();
  24. }
  25. //-------------------------------------------------------------------------
  26. void TExample::MultipleReached(TCounter *Sender)
  27. {
  28.   printf("Multiple=%d reached with val=%d\n", Sender->Multiple, Sender->Val);
  29. }
  30. //-------------------------------------------------------------------------
  31.