Da muss ich mich jetzt aber auch mal einklinken. Wenn FindComponent Nil zurückliefert, wenn die Komponente nicht gefunden ist, dann ist Lbl ja klar definiert. Warum knallt das denn nicht, wenn man auf die Caption von "Nil" zugreift?
Delphi-Quellcode:
Lbl := TLabel(
Nil);
// Lbl := Nil funktioniert auch
Lbl.Caption:='
wuppdi';
Showmessage(Lbl.Caption);
Die Message ist leer, aber warum läuft das ohne Zugriffsverletzung durch?
Being smart will count for nothing if you don't make the world better. You have to use your smarts to count for something, to serve life, not death.