Jeszcze raz o znajdowaniu komponentu..

0

Dlaczego po wpisaniu:

for x:=1 to ComponentCount-1 do
if (Components[x] is TLabel) and (TImage(Components[x]).Left=20) then
begin
coś tam 1
end else
begin
coś tam 2
end;

Program wykonuje coś tam 1 i coś tam 2? ( po kolei)
Czy nie powinno być jedno lub drugie????

;(

0

Tadek napisał:
Dlaczego po wpisaniu:
&gt
&gtfor x:=1 to ComponentCount-1 do
&gt if (Components[x] is TLabel) and (TImage(Components[x]).Left=20) then
Albo szukasz labela albo image popraw to.
Jednego i drugiego nie moze wykonac.--Pozdrawiam {hello}
Tomasz K.

0

Tadek napisał:
Dlaczego po wpisaniu:
&gt
&gtfor x:=1 to ComponentCount-1 do
&gt if (Components[x] is TLabel) and (TImage(Components[x]).Left=20) then
&gt begin
&gt coś tam 1
&gt end else
&gt begin
&gt coś tam 2
&gt end;
&gt
&gtProgram wykonuje coś tam 1 i coś tam 2? ( po kolei)
&gtCzy nie powinno być jedno lub drugie????

Powinno. Moze cośtam1 i costam2 wykonuje dla innych obrotów petli (innych wartości x)?
&gt
&gt ;(
&gt
&gt--Pawel {Delphi6 }

Po pierwsze: naciśnij F1

1 użytkowników online, w tym zalogowanych: 0, gości: 1