You can print the coming 5 Tuesday with the help built in Date function :-
static void dayofweek(Args _arg)
{
date d = today();
str s;
int i;
;
i= dayOfWk(d);
switch( i )
{
case 1:
d = d + 1;
break;
case 2:
d = d+7;
break;
case 3:
d = d+6;
break;
case 4:
d = d+5;
break;
case 5:
d = d+4;
break;
case 6:
d = d+3;
break;
case 7:
d = d+2;
break;
}
for(i=1;i<=5;i++)
{
s=dayName(dayOfWk(d));
info(strFmt(' %1 %2' , d , s));
d = d+7;
}
}
static void dayofweek(Args _arg)
{
date d = today();
str s;
int i;
;
i= dayOfWk(d);
switch( i )
{
case 1:
d = d + 1;
break;
case 2:
d = d+7;
break;
case 3:
d = d+6;
break;
case 4:
d = d+5;
break;
case 5:
d = d+4;
break;
case 6:
d = d+3;
break;
case 7:
d = d+2;
break;
}
for(i=1;i<=5;i++)
{
s=dayName(dayOfWk(d));
info(strFmt(' %1 %2' , d , s));
d = d+7;
}
}
No comments:
Post a Comment