Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi ,
We need to get number of days in a month for this I am planning to write a subroutine which can be used in other places aswell. I am just looking for a function like below:
<Return Param>SUB(vMonthCount ,vYear)
IF(vMonthCount = 2) THEN
IF(MOD($(vYear),4) = 0 and MOD($(vYear),100) <> 0 or MOD($(vYear),400) = 0) THEN
LET vMonthEndDay =28;
ELSE
LET vMonthEndDay =29;
END IF
IF ($(vMonthCount)=1 OR $(vMonthCount)=3)
LET vMonthEndDay =31;
ELSEIF
LET vMonthEndDay =30;
END IF
END SUB
Thanks
Dasu.G
There is no return value -- like Function -- available from SUB. What you can do is pass the name of a variable to to be set by the SUB. For example:
SUB DayCount(vMonthCount ,vYear, vMonthEndDay )
...
END SUB
CALL DayCount('2', '2013', vMyVar);
On return vMyVar=28
-Rob