Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ISO 8601 Week numbers anyone?
Message
 
 
To
17/06/2002 10:13:08
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00669202
Message ID:
00669407
Views:
11
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.


***************************************
Previous
Reply
Map
View

Click here to load this message in the networking platform