Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of Mondays in a month
Message
De
20/10/2016 12:55:21
 
 
À
20/10/2016 12:18:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01642129
Message ID:
01642162
Vues:
48
>
>Close Data All
>Set Date short
>Set Date French    &&change to american
>
>Create Cursor ycurs(xdate d,xmonth i,xday c(10))
>Local Date0
>Date0=Inputbox("Any date ?","",Trans(Date()) )
>Date0=Ctod(Date0)
>
>
>Local xm
>xm=Ctod("01/01/"+Trans(Year(Date0)) )
>
>
>For i=1 To 365   &&gather all dates of specified year of date typed
>	Insert Into ycurs Values (xm+i,Month(xm+i),Cdow(xm+i))
>Endfor
>
>
>Sele ycurs
>*Brow
>Browse  For  xmonth=Month(Date0) And Allt(xday)=="lundi" Nowait &&change to monday
>Count To nd  For xmonth=Month(Date0) And Allt(xday)=="lundi"
>Messagebox ( "month "+Trans(Month(Date0))+"/"+Trans(Year(Date0))+" contains : "+Trans(nd)+" lundi  ",0+32+4096)
>Use In "ycurs"
>
>Retu
>
>can extend to any day....
Merci, Yousfi.
That's a very clever solution.
I might not use it in this case, but I'm sure I'll find another use for it.
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform