Autor Beitrag
Tilo
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Mi 25.05.05 16:03 
Ich möchte am Freitag meinen Mitschüler ein Programm erläutern.
Ich verwende im Programm OnMouse Ereignisse.
MEine Frage ist weiso heist es z.b.
ausblenden Delphi-Quelltext
1:
 if ssleft in shift then anweisung					

und nicht
ausblenden Delphi-Quelltext
1:
 if shift.ssleft then anweisung					

?

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 25.05.05 16:07 
Das heißt die Anweisung wird ausgeführt wenn die Linke Maustaste gedrückt ist! Der procedur wird der Parameter TShiftState übergeben und TShiftState ist ein Objecttyp TShiftState = (ssLeft, ssMiddle, ssRight) und mit dem in ssLeft kann man auch fragen in [ssLeft..ssMiddle] dann wird die Anweisung ausgeführt wenn Linke oder Mittlere Taste gedrückt wird! oder wenn in [ssLeft..ssRight] dann beliebige Taste!

Wobei das mit "ssMiddle" weiß ich nicht ob es so heißt ich bin auch neu in Delphi!

Moderiert von user profile iconTino: Delphi-Tags hinzugefügt und überflüssige Zeilenumbrüche entfernt.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 25.05.05 21:21 
user profile iconJRegier hat folgendes geschrieben:
TShiftState ist ein Objecttyp TShiftState = (ssLeft, ssMiddle, ssRight)

Stimmt so nicht ganz:

ausblenden Classes.pas
 
83:
84:
{ ... }
  TShiftState = set of (ssShift, ssAlt, ssCtrl,
    ssLeft, ssRight, ssMiddle, ssDouble);


D.h. TShiftState is ein Set von Elementen und kein Record.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Tilo Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Do 26.05.05 14:33 
Und weil "set of" muss das über "in" abgefragt werden?
Wozu dder BEfhl gut ist habe ich schon rausgefunden, ich wollte nur wissen ob es einen besonderen Grund gibt für diese spezielle Abfrage.
Heiko
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3169
Erhaltene Danke: 11



BeitragVerfasst: Do 26.05.05 15:28 
Des wegen nicht.
Es hat einen ganz einfachen Grund.
- mit in fragst du ab, ob das Element gerade in der Menge drin ist oder nicht
- mit einem vergleich fragst du ab, ob genau nur das drin ist, und nichts merh oder weniger.
Tilo Threadstarter
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Do 26.05.05 20:10 
Danke für die Erklärung Heiko!