With the code below I'm trying to find text in a Tedit
,
procedure TForm2.CheckBox3Click(Sender: TObject);
var i: integer;
begin
existeCampo := false;
begin
for i := 1 to form1.variavel do
begin
if TEdit(form1.FindComponent('edt_variavel'+IntToStr(i))).Text = 'dose_adicional' then
begin
existeCampo := true;
break;
checkbox3.Checked := true;
end;
end;
if existeCampo = false then
begin
Showmessage('Para utilizar essa opção, adicione uma variavel com o nome de "dose_adicional");
Checkbox3.Checked :=false;
end;
end;
end;
I have already done several tests, and it does not find the text, even if I type correctly in the edit, why does this happen?