Fórum Várias COndições em um mesmo If #323412
15/06/2006
0
Estou fazendo uma tela de alteração de cadastro. masquero verificarantes se algumdado foimodificado.paraisto precisode várias condiçõesnum mesmo if.como fazer isto??
ex:
If txtTx1.Text = user2.FieldByname(´Taxa´).AsString ,
txtTx2.text = user2.FieldByname(´Txmax´).AsString ,
txtTx3.text = user2.FieldByname(´Txmax2´).AsString then
begin
ShowMessage (´>> Os valores não Foram Alterados!´);
end
ex:
If txtTx1.Text = user2.FieldByname(´Taxa´).AsString ,
txtTx2.text = user2.FieldByname(´Txmax´).AsString ,
txtTx3.text = user2.FieldByname(´Txmax2´).AsString then
begin
ShowMessage (´>> Os valores não Foram Alterados!´);
end
Tiago_hs
Curtir tópico
+ 0
Responder
Post mais votado
15/06/2006
Estou fazendo uma tela de alteração de cadastro. masquero verificarantes se algumdado foimodificado.paraisto precisode várias condiçõesnum mesmo if.como fazer isto??
ex:
If txtTx1.Text = user2.FieldByname(´Taxa´).AsString ,
txtTx2.text = user2.FieldByname(´Txmax´).AsString ,
txtTx3.text = user2.FieldByname(´Txmax2´).AsString then
begin
ShowMessage (´>> Os valores não Foram Alterados!´);
end
se as condições seguem o mesmo padrão vc pode complementá-la com o AND ou OR assim:
if ( txtTx1.Text = user2.FieldByname(´Taxa´).AsString ) and ( txtTx2.text = user2.FieldByname(´Txmax´).AsString) and ( txtTx3.text = user2.FieldByname(´Txmax2´).AsString ) And ( txtTxXXX.text = user2.FieldByname(´XXXX´).AsString ) then begin ShowMessage (´>> Os valores não Foram Alterados!´); //Comandos end else begin ShowMessage (´>> Os valores Foram Alterados!´); //Comandos end
Espero ter ajudado :wink:
Paullsoftware
Responder
Gostei + 1
Mais Posts
15/06/2006
Tiago_hs
Ok Resolveu Certinho. eu tava fazendo com o and antes só q n tinha colocado em () ae n funcionou hehehe. valew!!!
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)