home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
MINICOMP.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
1KB
|
35 lines
//----------------------------------------------------------------------------
//Borland C++Builder
//Copyright (c) 1987, 1997 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);
}
//-------------------------------------------------------------------------