Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Di 06.09.05 16:11 
Hi, wenn ich im with Block das Object auf das sich with bezieht angeben will
kann ich ja nicht Self schreiben, oder?

Also wenn ich z.B.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
 MyControl := TControl.Create(Self); 
 with MyControl do
 begin 
   Left := 23;
   Top := 36
   List.Add(???); // was schreibe ich hier anstatt ??? wenn ich dieses Control in eine List einfügen will
 end;



Moderiert von user profile iconGausi: Topic aus Programmierwerkzeuge verschoben am Di 06.09.2005 um 17:36
rochus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416

Win XP Prof, Fedora Core 4, SuSE 7.0
D7 Ent, D2005 Pers
BeitragVerfasst: Di 06.09.05 16:22 
MyControl

_________________
Im Nachhinein ist man immer ein Schlauch!
"Dream as if you'll live forever, live as if you'll die today!" James Dean
Udontknow
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2596

Win7
D2006 WIN32, .NET (C#)
BeitragVerfasst: Di 06.09.05 16:24 
Hallo!

Irgendwie ist die Frage ein wenig wirr. Du brauchst doch durch das With gar nicht das Objekt angeben, schreibe einfach
List.Add(Name); Name ist dann die Property des Objekts.

BTW: Das Debuggen ist immer furchtbar mühselig, daher habe ich mir die Verwendung von With abgewöhnt.

Cu,
Udontknow
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Di 06.09.05 16:45 
user profile iconUdontknow hat folgendes geschrieben:
Du brauchst doch durch das With gar nicht das Objekt angeben, schreibe einfach
List.Add(Name); Name ist dann die Property des Objekts.
Und wenn es um das Objekt selbst geht, und nicht nur um das Property Name? ;-)

Udontknow hat folgendes geschrieben:
BTW: Das Debuggen ist immer furchtbar mühselig
Ich finde den Programmierstil einfach zum Kotzen :mrgreen:

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Sa 10.09.05 14:00 
user profile icontommie-lie hat folgendes geschrieben:
user profile iconUdontknow hat folgendes geschrieben:
Du brauchst doch durch das With gar nicht das Objekt angeben, schreibe einfach
List.Add(Name); Name ist dann die Property des Objekts.
Und wenn es um das Objekt selbst geht, und nicht nur um das Property Name? ;-)


Ja genau das Object selbst und nicht sein Property!
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Sa 10.09.05 14:17 
List.Add (MyControl), wie im 2.Post schon erwähnt.