Page 1 of 1

calander

Posted: Mon Dec 04, 2006 11:05 am
by 970013
how do i make a calander on flowcode and when it reches a leep year it put in the extra day in febuary..

Leap Year

Posted: Mon Dec 04, 2006 4:02 pm
by Mark
The hard way is to code the following

The Gregorian calendar, the current standard calendar in most of the world, adds a 29th day to February in all years evenly divisible by 4, except for centennial years (those ending in -00), which receive the extra day only if they are evenly divisible by 400.

However, unless you seriously expect your project to still be running in 20 years time then it may be easier to code for the actual years:
2000/04/08/16/20 (???)
So
If Month = 2 (Feb) and Year = 2004 then month = month + 1 when days = 29
If Month = 2 (Feb) and Year = 2008 then month = month + 1 when days = 29 etc

(see related post on calendar)
The calculation route should be easier in C within flowcode as boostC seems to have some good features to find remainders from division calculations and can use 16 bit numbers)

Or can Flowcode 3 find if a remainder is 0 (i.e. exact division) within 16 bit calculations now?

thanks!!!

Posted: Fri Dec 08, 2006 10:33 am
by 970013
thank you very much i just did till 2020. an it works thanks a lot :D