Moin moin!
Also ich versuche zur zeit Hangman zu programieren, allerdings verstehe ich nicht, wie ich Bilder aus dem Teil "ImageList1" in mein Imagefeld reinbekomme. Ich habe für meine verschiedenen Hangmanabschnitte, jeweils ein neues Bild gemacht und will nun erreichen, dass das Programm immer ein Bild weiter schalten soll, wenn man einen falschen Buchstaben schreibt.
Delphi-Quelltext
1: 2:
| if Panel41.Caption='B'then if Panel40.Caption='B' then if Panel39.Caption='B' then if Panel38.Caption='B' then if Panel37.Caption='B' then if Panel36.Caption='B' then if Panel35.Caption='B' then if Panel34.Caption='B' then if Panel33.Caption='B' then if Panel32.Caption='B' then if Panel31.Caption='B' then if Panel30.Caption='B' then if Panel29.Caption='B' then if Panel28.Caption='B' then if Panel27.Caption='B' then Label1.Caption:=''; if Panel41.Caption<>'B'then if Panel40.Caption<>'B' then if Panel39.Caption<>'B' then if Panel38.Caption<>'B' then if Panel37.Caption<>'B' then if Panel36.Caption<>'B' then if Panel35.Caption<>'B' then if Panel34.Caption<>'B' then if Panel33.Caption<>'B' then if Panel32.Caption<>'B' then if Panel31.Caption<>'B' then if Panel30.Caption<>'B' then if Panel29.Caption<>'B' then if Panel28.Caption<>'B' then if Panel27.Caption<>'B' then Image1.Picture.LoadFromFile ('hot_mops.jpg'); |
Ein weiteres Problem erscheint bei folgendem Quellcodeabschnitt:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44:
| procedure TForm1.FormCreate(Sender: TObject); begin if Panel27.Visible=True then if Panel28.Visible=True then if Panel29.Visible=True then if Panel30.Visible=True then if Panel31.Visible=True then if Panel32.Visible=True then if Panel33.Visible=True then if Panel34.Visible=True then if Panel35.Visible=True then if Panel36.Visible=True then if Panel37.Visible=True then if Panel38.Visible=True then if Panel39.Visible=True then if Panel40.Visible=True then if Panel41.Visible=True then Image2.Picture.Loadfromfile ('Dragon DBGT SERIE 1.jpg') and Panel1.Visible:=False and Panel2.Visible:=False and Panel3.Visible:=False and Panel4.Visible:=False and Panel5.Visible:=False and Panel6.Visible:=False and Panel7.Visible:=False and Panel8.Visible:=False and Panel9.Visible:=False and Panel10.Visible:=False and Panel11.Visible:=False and Panel12.Visible:=False and Panel13.Visible:=False and Panel14.Visible:=False and Panel15.Visible:=False and Panel16.Visible:=False and Panel17.Visible:=False and Panel18.Visible:=False and Panel19.Visible:=False and Panel20.Visible:=False and Panel21.Visible:=False and Panel22.Visible:=False and Panel23.Visible:=False and Panel24.Visible:=False and Panel25.Visible:=False and Panel26.Visible:=False ; end; |
Hier zeigt er mir das an: [Fehler] Unit1.pas(649): Operator ist auf diesen Operandentyp nicht anwendbar
Wie kann ich das beheben, weil auch mein Lehrer da nicht weiter weiss.
Moderiert von
raziel: Delphi-Tags hinzugefügt