Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding Sundays
Message
De
12/04/2000 14:20:28
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00358746
Message ID:
00358838
Vues:
17
Well George I won the bet you found the errors :) Here is improved tested version :)
lparameters tnMonth, tnYear, tnDow, tnFDow
tnFdow = iif(type("tnFdow")#"N",1,tnFdow)
tnDow = iif(type("tnDow")#"N",1,tnDow)
tnYear = iif(type("tnYear")#"N",year(date()),tnYear)
tnMonth = iif(type("tnMonth")#"N",month(date()),tnMonth)

ldStart=ctod("^"+str(tnYear,4)+"/"+padl(int(tnMonth),2,"0")+"/"+"01")
ldEnd = gomonth(ldStart,1)-day(gomonth(ldStart,1))

IF dow(ldStart,tnFdow) # tnDow
  ldStart = ldStart + (7 + tnDow - dow(ldStart,tnFdow))
ENDIF
for ix = 0 to day(ldEnd-1) step 7
 if month(ldStart+ix)=month(ldStart)
    ? ldStart+ix, cdow(ldStart+ix), dow(ldStart+ix,tnFdow) = tnDow
 endif
endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform