Autor Beitrag
chriss1988
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 389

windows xp prof,home,windows98
delphi5
BeitragVerfasst: Di 13.06.06 14:29 
hi
ich hab ne einfache frage aber kann sie nicht lösen hab.
wollte ein teil kürzer haben, das mein jetziger viel zu lang ist.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
if (speedbutton1.Visible=false) and
   (speedbutton2.Visible=false) and
   (speedbutton3.Visible=false) and
   (speedbutton4.Visible=false) and
   (speedbutton5.Visible=false) and
   (speedbutton6.Visible=false) and
   (speedbutton7.Visible=false) and
   (speedbutton8.Visible=false) and
   (speedbutton9.Visible=false) and
   (speedbutton10.Visible=false) then
     showmessage('Das Spiel ist nun vorbei. Du hast '+ emoves.text +' Züge gebraucht und dabei ' + epoints.text +' Punkte geholt');
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 13.06.06 14:40 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
if not (speedbutton1.Visible or
   speedbutton2.Visible or
   speedbutton3.Visible or
   speedbutton4.Visible or
   speedbutton5.Visible or
   speedbutton6.Visible or
   speedbutton7.Visible or
   speedbutton8.Visible or
   speedbutton9.Visible or
   speedbutton10.Visible) then
     showmessage('Das Spiel ist nun vorbei. Du hast '+ emoves.text +' Züge gebraucht und dabei ' + epoints.text +' Punkte geholt');

Wenn mich meine Erinnerung an formale Logik nicht täuscht.
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 13.06.06 14:42 
das ganze ließe sich rein theoretisch auch mit FindComponent lösen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var i: byte;
begin
 for i := 1 to 10 do
  if TSpeedButton(FindComponent('SpeedButton'+IntToStr(i))).Visible = false then
   begin
     if i = 10 then
       showmessage('Das Spiel ist nun vorbei. Du hast '+ emoves.text +' Züge gebraucht und dabei ' + epoints.text +' Punkte geholt')
   end else
     break;
end;
chriss1988 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 389

windows xp prof,home,windows98
delphi5
BeitragVerfasst: Di 13.06.06 14:44 
das or würde doch aber bedeuten wenn button1 oder button2 visible sind dann ..

dann muss ich doch statt pr and nehem oder lieg ich da falsch?
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 13.06.06 14:45 
Dann sollte man aber die Tag-Eigenschaft zur Prüfung hinzu ziehen, falls noch andere SpeedButtons existieren.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Di 13.06.06 14:46 
user profile iconchriss1988 hat folgendes geschrieben:
das or würde doch aber bedeuten wenn button1 oder button2 visible sind dann ..

dann muss ich doch statt pr and nehem oder lieg ich da falsch?

Deswegen steht das alles in Klammern und ein "not" davor.
chriss1988 Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 389

windows xp prof,home,windows98
delphi5
BeitragVerfasst: Di 13.06.06 14:48 
@ NoTVerYEvilPzYchO

danke das geht
aber was bedeutet byte?
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 13.06.06 14:50 
Praktisch das selbe wie eine Integer-Variable, nur dass bloß 256 (0..255) Zeichen hineinpassen.
Eine Integer-Variable finde ich hier für Werte von 1-10 völlig übertrieben :P
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Di 13.06.06 15:41 
user profile iconNoTVerYEvilPzYchO hat folgendes geschrieben:
Praktisch das selbe wie eine Integer-Variable, nur dass bloß 256 (0..255) Zeichen hineinpassen.
Eine Integer-Variable finde ich hier für Werte von 1-10 völlig übertrieben :P

Korrektur: Ich weis was du meinst, ist aber missverständlich. Byte kann nur zahlen von 0 bis 255 annehmen und verbraucht so etwas weniger Speicher. 256 ZEICHEN, darunter versteh ich, dass es ein String[256] ist, oder 'könnte' das verstehen, nich dass ein Missverständnis auftritt ^^

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 13.06.06 15:48 
oh, eh, ja, meinte ich natürlich :oops:
Die Sonne schien mir wohl heute schon zu lange auf den Kopf :roll:

edit: Zahlen von 0..255 oder 256 Zeichen wenn A = 65, B = 66 usw ist.
Oder Zahlen von -127 bis + 127. :)
-> Aber grad so gerettet^^