problem to day counter is sloved

 

I posted a message and asked for help on creating a code to calculate up to 30 days and then send an alert saying " 30 days is calculated". After no one here was able to help me I managed to solve the problem my self. The code is below:

static int counter=0;
int newday=Day();
int oldday=newday-1;
if (oldday<=newday)
{
counter=counter+1;
Alert("Day=",counter);
}
if(counter>=31)
{
Alert("30 days is calculated");
return(false);
 
your code will not cound sundays..
 
Thank you for your comments. However, please note the purpose of this program is to count only 31 days regardless of which day it is,
Reason: