Erro ´is not a valid integer value´

Delphi

09/05/2004

:cry:
Ao tentar zerar os Edits:

for I:= 0 to ComponentCount -1 do
if (Components[I] is TEdit) then
TEdit(Components[I]).Text:= ´´;

retorna o erro. Não consigo achar o problema, pode ajudar?

Obrigada
Fab
:oops:


Fab

Fab

Curtidas 0

Respostas

Aroldo Zanela

Aroldo Zanela

09/05/2004

Colega,

Apenas declarei a variável I como integer, copiei, colei e funcionou.

var i: Integer;
begin
  for I:= 0 to ComponentCount -1 do
    if (Components[I] is TEdit) then
      TEdit(Components[I]).Text:= ´´;
end;



GOSTEI 0
Edilcimar

Edilcimar

09/05/2004

o problema é que talvez vc esteja tentando transformar
edit1.text := ´´ em um inteiro por isto o erro


GOSTEI 0
Fab

Fab

09/05/2004

Realmente utilizo alguns StrToInt, mas se o problema é esse, como inicialmente, levando em consideração que todo TEdit é Text, não causa erro? Estou tentando somente estabelecer a posição inicial do TEdit que é ´´ (vazio) - acho!.

Como resolver este problema? Tenho muitos Edits para fazer um a um.

Obrigada
Fab


GOSTEI 0
Fabio.hc

Fabio.hc

09/05/2004

Como disse o edilcimar, talvez vc tem alguma coisa parecido com este exemplo em algum edit. Sem esta linha [b:71ed585f55]if Edit3.Text <> ´´ then[/b:71ed585f55] dá erro.

Ex:
procedure TForm1.Edit3Change(Sender: TObject);
var x:integer;
begin
   if Edit3.Text <> ´´ then
      x:=strtoint(Edit3.Text);
end;



GOSTEI 0
POSTAR