Conversao de variaveis String e boolean
Estou tentando que apareca uma messagebox qdo o usuario tentar cadastrar um nome em branco (Sou novo)
var
msgbox: boolean;
begin
if txtnome.Text = ´ ´ then
msgbox = application.MessageBox(´Quer gravar com o campo ´NOME´ em Branco?´,´Atencao´, MB_YESNO + MB_ICONQUESTION);
if msgbox = IDYES
tabcliente.Post;
else
txtnome.SetFocus
end;
end;
Gostaria que alguem pudesse me ajudar a converter a maledita string em boolean e que funcionasse. Se alguem puder me ajudar por favor meu e-mail é rodrigobocatto@ubbi.com.br. Agradeço!!!
var
msgbox: boolean;
begin
if txtnome.Text = ´ ´ then
msgbox = application.MessageBox(´Quer gravar com o campo ´NOME´ em Branco?´,´Atencao´, MB_YESNO + MB_ICONQUESTION);
if msgbox = IDYES
tabcliente.Post;
else
txtnome.SetFocus
end;
end;
Gostaria que alguem pudesse me ajudar a converter a maledita string em boolean e que funcionasse. Se alguem puder me ajudar por favor meu e-mail é rodrigobocatto@ubbi.com.br. Agradeço!!!
Rodrigaocs
Curtidas 0
Respostas
Motta
28/07/2003
var
//msgbox: boolean;
begin
if txtnome.Text = ´ ´ then
if application.MessageBox(´Quer gravar com o campo ´NOME´ em Branco?´,´Atencao´, MB_YESNO + MB_ICONQUESTION) = IDYES
tabcliente.Post;
else
txtnome.SetFocus
end;
end;
// como retorna uma boolean pode-se tratar direto nela
//msgbox: boolean;
begin
if txtnome.Text = ´ ´ then
if application.MessageBox(´Quer gravar com o campo ´NOME´ em Branco?´,´Atencao´, MB_YESNO + MB_ICONQUESTION) = IDYES
tabcliente.Post;
else
txtnome.SetFocus
end;
end;
// como retorna uma boolean pode-se tratar direto nela
GOSTEI 0