Please enable JavaScript to view this site.

ESL Documentation

Navigation: » No topics above this level «

FAQs_CodeSamples_Q03.inc

Scroll Prev Top Next More

subroutine NextWorkDay (string: Date, integer: DaysFromNow) is

 

integer    Day

           Month

           Year

           JulianDate

 

string     MonthString

           DayString

 

    extract from Date

        take number Day

        skip "/" 

        take number Month

        skip "/"

        take number Year

 

    copy DateToJulian(Year, Month, Day) to JulianDate

    copy (JulianDate + DaysFromNow) to JulianDate

 

    extract from JulianToDate(JulianDate)

        take 4 Year

        take 2 Month

        take 2 Day

 

    switch WeekDay(Year, Month, Day) is

        case char "SUNDAY" is

            copy (JulianDate + 1) to JulianDate

        case char "SATURDAY" is

            copy (JulianDate + 2) to JulianDate

        default is

    end switch

 

    extract from JulianToDate(JulianDate)

        take 4 Year

        take 2 MonthString

        take 2 DayString

 

    copy DayString "/" MonthString "/" Year to Date