function month_days returns int (iDate as date):
/*
* Start at 28 as no month has < 28 days
*/
iDate = date(month(iDate), 28, year(iDate)).
repeat:
if month(iDate) <> month(iDate + 1) then leave.
iDate = iDate + 1.
end.
return day(iDate).
end function.