1) pass the dates to a function
2) evaluate failures first and call return false from the function early-on
--- this eliminates the use of "else" and can remove some of the nesting.
thines01
Postaholic
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
Agreed.
Make a function.
Test year -- return false if bad
Test month -- return false if bad
Test day <1 & >31 -- return false if bad
Make switch for:
31 day months
30 day months
Feb...
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944