Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Days in month
Message
 
 
To
05/11/2007 12:07:15
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 8
Miscellaneous
Thread ID:
01266644
Message ID:
01266763
Views:
9
greg,

The code depends on SET DATE AMERICAN to be in effect. It'll produce incorrect resut or blow up with other settings. It's better to use DATE() function. Also YEAR() function requires an argument.
RETURN DAY(GOMONTH(DATE(pnYear, pnMonth,1),1) -1)
>An error in the formula - it should be:
>
>
>FUNCTION DayInMonth
>LPARAMETERS pnMonth
>RETURN DAY(GOMONTH(CTOD(TRANSFORM(pnMonth)+"/01/"+TRANSFORM(YEAR())),1)-1)
>
>
>Should use CTOD() rather than DTOC()...
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform