If com multiplas strings...

Delphi

09/04/2003

Preciso fazer uma verificação de texto em um ComboBox, mas quando coloco:

If ComboBox1.Text = ´texto1´ or ´texto2´ then

O que está errado? Como corrigir?

Agradeço qualquer ajuda...

Obrigado.


Inutaishou

Inutaishou

Curtidas 0

Respostas

Tiocassio

Tiocassio

09/04/2003

if (ComboBox1.Text=´Texto1)or(ComboBox1.Text=´Texto2) then


GOSTEI 0
Hhhhhh

Hhhhhh

09/04/2003

if (ComboBox1.Text = ´texto1´) or (Combo1Box.Text = ´texto1´) then



GOSTEI 0
Inutaishou

Inutaishou

09/04/2003

Funcionou, Muito Obrigado pessoal.


GOSTEI 0
Thesanto

Thesanto

09/04/2003

o que á de errado nisso ?

procedure TF_Bus.SpeedButton1Click(Sender: TObject);
begin
if ComboBox_Opcao.Items = ´Cliente´ then
begin
F_BCli.showmodal;
end;
end;


GOSTEI 0
Alysson

Alysson

09/04/2003

pq

Items do Combobox é StringList....

pra verificar os items do ComboBox vc faz assim:

if combobox.items.text = ´Cliente´ then
begin
end;




ou para verificar o item selecionado:

if lowercase(combobox.text) = lowercase(´Cliente´) then
begin
end;



// é bom por Lowercase, pois deixa tudo minúsculo. no delphi
´Alguem´ é diferente de ´alguem´

bota minusculo em tudo pra a verificação ser melhor


GOSTEI 0
POSTAR