Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ISO 8601 Week numbers anyone?
Message
 
 
À
17/06/2002 10:13:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00669202
Message ID:
00669407
Vues:
10
Toget the weeknumber use DOW(this.value)
*******************************************

This following code works checkit.
i have two text boxes both are dates
i select the date in the first text box and this code automatically increments 15 working days in the next text boxes excluding weekends.
thiscode is written in the valid event of the first text box.
Sorry i am very new to VFP just started learning.
***************************************************************

LOCAL mRec_Dt,mResp_due,mResp_Due1,i,j
Ret_val = .t.
DO CASE
CASE EMPTY(this.value)
ret_val = .f.

CASE EMPTY(ThisForm.txtResp_due.Value) AND NOT EMPTY(This.Value)

mRec_Dt=This.Value
mResp_Due = mRec_Dt+15
mResp_Due1 = 0


For i = 1 to 15
if DOW(mRec_Dt+i) =1 then
mResp_Due1=mResp_Due1 + 2

Else
if DOW(mRec_Dt+i)=7 then
mResp_Due1=mResp_Due1 +1
endif
endif
EndFOR
mResp_Due = mRec_Dt+15+mResp_Due1


ThisForm.txtResp_due.Value = mResp_Due
ENDCASE
ThisForm.Status1.StatusSub
ThisForm.GenStatusDisplay1.refresh
RETURN .t.


***************************************
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform