Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 3 Tools : LEAPYEAR

LEAPYEAR
Returns a logical value indicating whether a given year is a leap year. (F)
Invocation
value = LEAPYEAR(year)
 
Example
The rules in this example:
1.
2.
Rule Using LEAPYEAR:
LEAPYEAR is called in as a condition to the DAYS_OF_YEAR rule:

 
DAYS_OF_YEAR(YEAR);
_ ---------------------------------------------------------------------
_ LEAPYEAR(YEAR); | Y N
_ ------------------------------------------------------------+--------
_ RETURN(366); | 1
_ RETURN(365); | 1
_ ---------------------------------------------------------------------

 
Definition of the YEAR_HOURS Rule:
DAYS_OF_YEAR is called in as a function to the YEAR_HOURS rule:

 
YEAR_HOURS(YEAR);
_ LOCAL NUM_HOURS;
_ ------------------------------------------------------------+--------
_ NUM_HOURS = DAYS_OF_YEAR(YEAR) * 24; | 1
_ RETURN(NUM_HOURS); | 2
_ ---------------------------------------------------------------------

 
When YEAR_HOURS is executed with the year 1998 used as the argument it returns the following:
RESULT OF RULE YEAR_HOURS IS 8760.

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved