//=============================================================================
// INC COUNTER
//=============================================================================
void inc_counter(unsigned char *icount)
{
//-----------------------------------------------------
// the counter values are stored as text.
// so inc them using a special procedure starting
// at the final (right) character then working back.
//-----------------------------------------------------
// loop and inc the counter
i = 15;
while(i < 16)
{
if(icount[i] < '0') icount[i] = '0'; // change digit to '0' before inc it
icount[i]++; // inc the digit
if(icount[i] <= '9') break; // if no digit roll, inc is done
icount[i] = '0'; // digit roll, so clr it, and inc next
i--;
}
// check for final roll and do a counter reset, to put blanks back in
if(icount[0] == '0') clear_counter(icount);
}
//-----------------------------------------------------------------------------