DATAS
TENHO UM CAMPO EM MINHA TABELA DE DATA DO TIPO DATA. NO
DELPHI USO UMA MÁSCARA DE DATA PARA ESSE CAMPO. COMO FAÇO P/ VERIFICAR QUANDO UMA DATA É VÁLIDA NESSE CAMPO????
DELPHI USO UMA MÁSCARA DE DATA PARA ESSE CAMPO. COMO FAÇO P/ VERIFICAR QUANDO UMA DATA É VÁLIDA NESSE CAMPO????
Anonymous
Curtidas 0
Respostas
Rafael Silva
04/02/2003
Porque voce nao usa um campo DATETIMEPICKER na paleta WIN32, poque assim não tem como inserir data inválida.
GOSTEI 0
Anonymous
04/02/2003
Você pode criar a seguinte função:
function Data_Correta : Boolean
begin
try
StrToDate(Edit1.Text);
result := True;
except
result := False;
end;
//se a data estiver errada, a função retorna FALSE, se estiver certo retorna TRUE
function Data_Correta : Boolean
begin
try
StrToDate(Edit1.Text);
result := True;
except
result := False;
end;
//se a data estiver errada, a função retorna FALSE, se estiver certo retorna TRUE
GOSTEI 0