home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 April
/
Chip_1997-04_cd.bin
/
prezent
/
cb
/
data.z
/
MINICOMP.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-01-16
|
1KB
|
35 lines
//----------------------------------------------------------------------------
//Borland C++ Builder
//Copyright (c) 1987 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
//-------------------------------------------------------------------------
// minicomp.cpp - uses the TCounter example component
//-------------------------------------------------------------------------
#include "minicomp.h"
#include <stdio.h>
#include <stdlib.h>
//-------------------------------------------------------------------------
main()
{
TExample example;
return 0;
}
//-------------------------------------------------------------------------
TExample::TExample()
{
TCounter Counter(7);
int i;
Counter.OnMultiple = MultipleReached;
for (i=0; i < 100; i++)
Counter.Increment();
}
//-------------------------------------------------------------------------
void TExample::MultipleReached(TCounter *Sender)
{
printf("Multiple=%d reached with val=%d\n", Sender->Multiple, Sender->Val);
}
//-------------------------------------------------------------------------