Einzelnen Beitrag anzeigen

TurboMartin

Registriert seit: 13. Feb 2006
Ort: Bad Honnef
765 Beiträge
 
Turbo Delphi für Win32
 
#12

Re: Zugriffsverletzung bei if in einer for-Schleife

  Alt 18. Mai 2006, 17:56
danke dafür, aber ich hab jetzt wieder ein problem.
Delphi-Quellcode:
procedure TForm1.Timer1Timer(Sender: TObject);
var I: Integer;
    J: Integer;
begin
  for I := 1 to 13 do
    begin

      if (for J := 1 to 13 do
         begin
           (((FindComponent('Image' + IntToStr(J)) as TImage).Left) >= ((FindComponent('Image' + IntToStr(I)) as TImage).Left + 8))
         end;) then ((FindComponent('Image' + IntToStr(I)) as TImage).Left) := (FindComponent('Image' + IntToStr(I)) as TImage).Left
         else if ((FindComponent('Image' + IntToStr(I)) as TImage).Top = 96) and ((FindComponent('Image' + IntToStr(I)) as TImage).Left = 8) then
            (FindComponent('Image' + IntToStr(I)) as TImage).Top := 48
          else
            if ((FindComponent('Image' + IntToStr(I)) as TImage).Top = 48) and ((FindComponent('Image' + IntToStr(I)) as TImage).Left = 536) then
              (FindComponent('Image' + IntToStr(I)) as TImage).Top := 96
            else
              if ((FindComponent('Image' + IntToStr(I)) as TImage).Top = 96) and ((FindComponent('Image' + IntToStr(I)) as TImage).Left = 536) then
                (FindComponent('Image' + IntToStr(I)) as TImage).Top := 144
              else
                if ((FindComponent('Image' + IntToStr(I)) as TImage).Top = 144) and ((FindComponent('Image' + IntToStr(I)) as TImage).Left >= 9) then
                  (FindComponent('Image' + IntToStr(I)) as TImage).Left := (FindComponent('Image' + IntToStr(I)) as TImage).Left - 8
                else
                  if ((FindComponent('Image' + IntToStr(I)) as TImage).Top = 144) and ((FindComponent('Image' + IntToStr(I)) as TImage).Left = 8) then
                    (FindComponent('Image' + IntToStr(I)) as TImage).Top := 96
                  else (FindComponent('Image' + IntToStr(I)) as TImage).Left := (FindComponent('Image' + IntToStr(I)) as TImage).Left + 8;
     end;
end;
beim end fon der forschleife(die mit J), komm der error:
Statement expected, but expression of 'Boolean' found.
was muss ich ändern?
Tomorrow will be cancelled due to lack of interest.

  Mit Zitat antworten Zitat