Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
First day of week
Message
De
30/09/2003 10:38:39
 
 
À
30/09/2003 08:59:15
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00833397
Message ID:
00833479
Vues:
23
Juan Rossano send me this function in GUFA List.

It Work Ok for me.
function WSemana
lParameters lpSemana, lpAnio
 
if type("lpSemana") # "N" or type("lpAnio") # "N" or not between(lpAnio,1900,9999)
 return {} && Devuelve vacio en caso de error en parametros
endif
 
local lDiaUno, lSemanaUno, lInicioAnio, lInicioDia, lInicioReal, lDiaSemana
 
lDiaUno = set("fdow")
lSemanaUno = set("fweek")
 
lInicioAnio = ctod("01/01/"+padl(lpAnio,4,"0"))
lInicioDia = dow(lInicioAnio)
lInicioReal = lInicioAnio - lInicioDia + lDiaUno
 
do case
case lSemanaUno = 1
 lCantidadSemana = lpSemana - 1
case lSemanaUno = 2
 lCantidadSemana = iif(lInicioAnio-lInicioReal>3,lpSemana,lpSemana-1)
case lSemanaUno = 3
 lCantidadSemana = iif(lInicioAnio>lInicioReal,lpSemana,lpSemana-1)
otherwise
 lCantidadSemana = 0
endcase
 
lDiaSemana = lInicioReal + 7 * lCantidadSemana - day(lInicioAnio) + 1
 
return lDiaSemana
Regards,
José Luis.

Quidquid latine dictum sit, altum sonatur

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform