Autor Beitrag
Stread
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Sa 10.01.09 19:27 
Ich möchte dass wenn diesenier Brushs dieselbe Farbe haben dass dann etwas ausgelöst wird. Bis jetzt habe ich
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  if Shape13.Brush.Color := clNavy and
     Shape14.Brush.Color := clNavy and
     Shape15.Brush.Color := clNavy and
     Shape16.Brush.Color := clNavy then
      begin


Nun meldet Delphi aber in Zeile 1: Ausdruckstyp muss BOOLEAN sein? Wie soll ich das machen?
WInfo
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Sa 10.01.09 19:33 
Moin Moin Stread,

du verbuchselst den Zuweisungsoperator (:=) mit dem Vergleichsoperator (=).
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 10.01.09 19:39 
Außerdem musst du die Vergleiche klammern, wenn du mehere (mit and, or etc.) verknüpfst.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  if (Shape13.Brush.Color = clNavy) and
     (Shape14.Brush.Color = clNavy) and
     (Shape15.Brush.Color = clNavy) and
     (Shape16.Brush.Color = clNavy) then
  begin
Stread Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Sa 10.01.09 19:48 
Ah Ok habs wieder verwechselt :oops:

Erkennt Delphi denn die Brush.Color? Oder muss man das anderst machen?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm12.FormCreate(Sender: TObject);
begin
  if (Shape13.Brush.Color = clNavy) and
     (Shape14.Brush.Color = clNavy) and
     (Shape15.Brush.Color = clNavy) and
     (Shape16.Brush.Color = clNavy) then
  begin
   Showmessage('Gewonnen');
    end;

end;


Zuletzt bearbeitet von Stread am Sa 10.01.09 20:04, insgesamt 1-mal bearbeitet
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Sa 10.01.09 21:03 
Brush.Color ist nicht die Farbe des Shapes sondern die Farbe, die du benutzen würdest, würdest du z.B. per Canvas.LineTo zeichnen. Richtig wäre wahrscheinlich nur Shape.Color.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 10.01.09 21:11 
Canvas.LineTo benutzt Pen.Color. Außerdem besitzt TShape gar keine Color-Property.
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Sa 10.01.09 21:20 
user profile iconDeddyH hat folgendes geschrieben Zum zitierten Posting springen:
Canvas.LineTo benutzt Pen.Color. Außerdem besitzt TShape gar keine Color-Property.
In der Tat, Brush.Color ist die richtige Eigenschaft.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.