%META:TOPICINFO{author="ChrisBartram" date="1149890660" format="1.1" version="1.1"}% %META:TOPICPARENT{name="Hp3000DateXeqs"}%
parm _month=!HPMONTH,_year=!HPYYYY
comment
comment Calculates the number of days in the specified month
comment month and year default to current if not specified
comment
comment  Sets a CIVar _daysof which can be used in other calculations
comment
comment   Chris Bartram
comment

if !_month=4 or !_month=6 or !_month=9 or !_month=11 then
  setvar _daysof 30
 else
  if !_month=2 then
    if ((!_year mod 4=0) and (!_year mod 100<>0)) or (!_year mod 400=0) then
      setvar _daysof 29
     else
      setvar _daysof 28
    endif
   else
    setvar _daysof 31
  endif
endif
-- Main.ChrisBartram - 09 Jun 2006