Ver Mensaje Individual
  #3  
Antiguo 06-06-2012
Avatar de thecidmx
thecidmx thecidmx is offline
Miembro
NULL
 
Registrado: oct 2011
Posts: 93
Reputación: 13
thecidmx Va por buen camino
Smile ejemplo

Código Delphi [-]
var
  Present,last : TDateTime;
  m1,m2,d1,d2,ano1,ano2 : word;
  dia,mes,ano : integer;
begin
  dia := 0;
  mes := 0;
  ano := 0;
  m1  := 0;
  m2  := 0;
  d1  := 0;
  d2  := 0;
  ano1 := 0;
  ano2 := 0;
  present := now();
  decodedate(present,ano1,m1,d1);
  decodedate(strtodate(MaskEdit1.text),ano2,m2,d2);
  dia := d2-d1;
  mes := m2-m1;
  ano := ano1-ano2;
  if (ano <= 1) and (m1=12) then
    begin
       m1 :=m1;
    end
  else
    begin
       if ano >= 1 then
         m1 := ((ano*12)+ m1-1)
       else
         m1 := m1;
    end;
  edit3.Text := inttostr(m1);

haci ya calcula los mese ahi te dejo componer los verificadores :P, y hace correr correctos
__________________
La mejor forma de aprender es, compartir el conocimiento adquirido.
Responder Con Cita