How to determine when BAR has incremented

 
Hello everyone,

Other than using Volume[0]=0, how would I programatically determine when a new BAR begins (under any time period) without getting into messy TIME calculations, etc.

I appreciate all replies.

Thanks!
-charliev
 
   datetime prevtime=0;
...
   if(prevtime == Time[0]) return(0);
   prevtime = Time[0];
 
bool CheckNewBar()
{
if (lastBars != Bars)
{
lastBars = Bars;
//Print("New Bar: ",mytime);
return(1);
}
else
{
//Print("No New Bar: ",mytime);
return(0);
}
}
 
I see, simple. Thanks!
-charliev
Reason: