How about this?

How about this?  (new/changed code in blue/bold)

SELECT "luHolidays"
&& build a text list of the holiday dates
SCAN
    STORE  lcTextList_Dates + chr(13) + TRANS( dDate ) TO lcTextList_Dates
ENDSCAN

. . .

lnCtr = lnCtr + EVALUATE(tcCursor +
".nEstimatedTime") - EVALUATE(tcCursor + ".nActualTime")
                    lnNumDaysFromNow = INT(lnCtr / tnMaxHrs)
                    ldDate = DATE() && starting date
                    lnLoop = 0
                    DO WHILE lnLoop <= lnNumDaysFromNow
                        IF NOT(INLIST(DOW(ldDate),1,6) OR
TRANS(ldDate) + CHR(13) $ lcTextList_Dates,"luHolidays","dDate")) THEN && only 
count if not a weekend
and not a holiday
                            lnLoop = lnLoop + 1
                        ENDIF
                        ldDate = ldDate + 1
                    ENDDO && WHILE lnLoop <= lnNumDaysFromNow
                    REPLACE nTimeSpent WITH lnCtr, dExpected WITH ldDate ;
                        IN (tcCursor)

MB Software Solutions wrote:

> MB Software Solutions wrote:
> > Matthew Jarvis wrote:
> >
> >> Since it sounds like Holidays is just a lookup table, why not load it
> >> into an array at app startup?
> >>
> >> Not much diff than a local cursor, but....
> >>
> >>
> >
> > True, and performance-wise I'm sure that'd be quick (if not the
> > quickest!), but alas you've exposed me...I really don't like dealing
> > with arrays as much.  ;-)
> >
> >
> Here's the segment of code in question:
>
>                     lnCtr = lnCtr + EVALUATE(tcCursor +
> ".nEstimatedTime") - EVALUATE(tcCursor + ".nActualTime")
>                     lnNumDaysFromNow = INT(lnCtr / tnMaxHrs)
>                     ldDate = DATE() && starting date
>                     lnLoop = 0
>                     DO WHILE lnLoop <= lnNumDaysFromNow
>                         IF NOT(INLIST(DOW(ldDate),1,6) OR
> SEEK(ldDate,"luHolidays","dDate")) THEN && only count if not a weekend
> and not a holiday
>                             lnLoop = lnLoop + 1
>                         ENDIF
>                         ldDate = ldDate + 1
>                     ENDDO && WHILE lnLoop <= lnNumDaysFromNow
>                     REPLACE nTimeSpent WITH lnCtr, dExpected WITH ldDate ;
>                         IN (tcCursor)
>
> --
> Michael J. Babcock, MCP
> MB Software Solutions, LLC
> http://mbsoftwaresolutions.com
> http://fabmate.com
> "Work smarter, not harder, with MBSS custom software solutions!"
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to