home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
COUNTER.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
1KB
|
26 lines
//----------------------------------------------------------------------------
//Borland C++Builder
//Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
//-------------------------------------------------------------------------
// counter.cpp - example of a small, non-visual counter component
//-------------------------------------------------------------------------
#include "counter.h"
//-------------------------------------------------------------------------
TCounter::TCounter(int Multiple)
{
FMultiple = Multiple;
}
//-------------------------------------------------------------------------
void TCounter::Clear()
{
FVal = 0;
}
//-------------------------------------------------------------------------
void TCounter::Increment()
{
if (((++FVal) % FMultiple) == 0)
OnMultiple(this);
}
//-------------------------------------------------------------------------