Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Week array
Message
De
23/09/2002 09:01:58
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
23/09/2002 07:05:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00703287
Message ID:
00703321
Vues:
15
>Hi all,
>
>I want to create an array with a list of week ending dates (Friday).
>Anyone know the easiest way of doing this?
>
>Thanks in advance,
>
>Ger.
LOCAL ARRAY arrFridays[1]
lnFridays = Days2Array(DATE(),DATE(2003,1,1),6,@arrFridays)
? lnFridays
DISPLAY MEMORY LIKE arrFridays

Function Days2Array
  Lparameters tdStart, tdStop, tnDow, taArray
  Local lnWeeks,ix, lnBase
  lnWeeks = Int((tdStop-(tdStart-Dow(tdStart,tnDow) + 1))/7)
  If tdStart = (tdStart-Dow(tdStart,tnDow) + 1)
    lnWeeks =lnWeeks + 1
    lnBase = -1
  Else
    lnBase = 0
  Endif
  If lnWeeks > 0
    Dimension taArray[lnWeeks]
    For ix = 1 To lnWeeks
      taArray[ix] = tdStart - Dow(tdStart,tnDow) + 1 + 7 * (ix + lnBase)
    Endfor
  Endif
  Return lnWeeks
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
Répondre
Fil
Voir

Click here to load this message in the networking platform