Várias COndições em um mesmo If
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
Curtidas 0
Melhor post
Paullsoftware
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:
GOSTEI 1
Mais Respostas
Tiago_hs
15/06/2006
Ok Resolveu Certinho. eu tava fazendo com o and antes só q n tinha colocado em () ae n funcionou hehehe. valew!!!
GOSTEI 0