Fórum ´ / / ´ is not a valid date and time #276490
11/04/2005
0
Estou com esse erro (´ / / ´ is not a valid date and time) em minha aplicação. Quando a pessoa não digita nenhum valor no campo Data, ele retorna esse erro na tela. Como faço para tratá-lo???
Quem puder me ajudar, agradeço desde já!!!
Cristiano
Cristianojedi
Curtir tópico
+ 0Posts
11/04/2005
Sremulador
Gostei + 0
11/04/2005
Ariovaldo
Declare esta funcão
function CheckDate(Sender: TField; Text: String): Boolean;
begin
Result := False;
if (Text = ´ / / ´) or (Text = ´ / / ´) then begin
Sender.Clear;
Result := True;
end
else begin
try
Sender.AsString := Text;
Result := True;
except
messagedlg(´Data Inválida !!!´, mtInformation,[mbOk],0 );
if Screen.Cursor = crHourGlass then begin
Screen.Cursor := crDefault;
end;
end;
end;
end;
e no evento onset text coloque
if not ( CheckDate(Sender,Text) ) then begin
Abort;
end;
Gostei + 0
11/04/2005
Cristianojedi
Muito obrigado sremulador!!!
Cristiano Mário
Gostei + 0
11/04/2005
Cristianojedi
Cristiano
Gostei + 0
11/04/2005
Ariovaldo
Gostei + 0
11/04/2005
Cristianojedi
Abraço!!!
Cristiano Mário
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)