+1 888 340 6572

EndOfMonth

Article/Author: Omega Research Inc., 1995

Download: FUNCTION-ENDOFMONTH.ELA

File Includes: Function - EndOfMonth

EasyLanguage Code:
VALUE1 = DATETOJULIAN(DATE);


FOR VALUE2 = 0 TO 32 BEGIN
VALUE1 = VALUE1 + 1;
VALUE4 = JULIANTODATE(VALUE1);
IF DAYOFMONTH(VALUE4) CROSSES UNDER DAYOFMONTH(DATE) THEN BEGIN
VALUE5 = VALUE1 - 1;
VALUE6 = JULIANTODATE(VALUE5);
VALUE2 = 32;
END;
END;

FOR VALUE10 = 0 TO 32 BEGIN
IF DAYOFWEEK(VALUE6) > 0 AND
DAYOFWEEK(VALUE6) < 6 THEN
VALUE4 = VALUE6 ELSE BEGIN
VALUE5 = VALUE5 - 1;
VALUE6 = JULIANTODATE(VALUE5);
VALUE4 = VALUE6;
END;
END;

ENDOFMONTH = VALUE4;