Claro, lo que sucede es que yo necesito guardar fechas que correspondan a los dias lunes, en este caso trabajo con este mes, octubre.
Entonces lo que realizo primero es saber en que dia de la semana estoy ubicada hoy.. Para eso trabajo con la funcion DayOfTheWeek.
Hecho esto, yo pregunto lo siguiente:
Código Delphi
[-]
if hoy=1 then begin
DM.DSET_agen_turFECHA.Value:=Now; end;
if hoy=2 then begin
ProximaFecha:=IncDay(Date,6);
DM.DSET_agen_turFECHA.Value:=Proximafecha;
end;
if hoy=3 then begin
ProximaFecha:=IncDay(Date,5);
DM.DSET_agen_turFECHA.Value:=ProximaFecha;
end;
if hoy=4 then begin
ProximaFecha:=IncDay(Date,4);
DM.DSET_agen_turFECHA.Value:=Proximafecha;
end;
if hoy=5 then begin
ProximaFecha:=IncDay(Date,3); DM.DSET_agen_turFECHA.Value:=Proximafecha; end;
if hoy=6 then begin
ProximaFecha:=IncDay(Date,2);
DM.DSET_agen_turFECHA.Value:=Proximafecha;
end;
if hoy=7 then begin
ProximaFecha:=IncDay(Date,1);
DM.DSET_agen_turFECHA.Value:=Proximafecha;
end;
Hasta aca me funciona barbaro, el problema es que yo no quiero que me guarde solo el lunes proximo, sino todos los del mes y eso lo quiero realizar con el FOR.. que recorre desde el dia de hoy hasta fin de mes 31/10/2011 (ultimo lunes). Para ello necesito algo que incremente la semana sino nunca voy a llegar a fin de mes..
No se si me logras entender?.