Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Anyone have a AfterFirstBusDayOf Month function?
Message
De
16/01/2003 17:13:07
Bill Drew
Independent Consultant
Chicago, Illinois, États-Unis
 
 
À
16/01/2003 13:33:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00742471
Message ID:
00742664
Vues:
23
Thanks Cetin and Steve:

Here is what I came up with -- using a table of holidays that is maintained in our company.
func IsAfterFirBusDay
LPARAMETERS indate
LOCAL lRetVal,dayofmonth,l_offday
IF !USED("Holiday)
   USE n:\foxprow\holiday order date IN 0
ELSE
   SELECT HOLIDAY
ENDI
*start out with the first day of month
dayofmonth = indate - DAY(indate)+1
l_offday = .t.
DO WHILE l_offday
   IF BETWEEN(DOW(dayofmonth),2,6)
      * passes 1st test -- mon thru fri
      IF !SEEK(dayofmonth)
         * passes 2nd test -- not in the holiday table
         l_offday = .f.
      else
         * it is a holiday -- don't change l_offday
         IF !trade
            *  wait a minute -- it is in holiday table but we trade on that day
            l_offday = .f.
         ENDIF
      ENDIF 
   ENDIF
   IF l_offday
      * it was a non working day -- check the next
      dayofmonth = dayofmonth + 1
   endi
ENDDO
USE IN SELECT("holiday")
* if orig date is after the first business day retu .t.
RETURN indate > dayofmonth 
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform