Autor Beitrag
curtiss
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59



BeitragVerfasst: Do 26.01.06 00:37 
Habe folgendes Problem,

Ich muss den Objektnamen in einen String packen, und danach aufteilen.

ausblenden Delphi-Quelltext
1:
cool:= (sender as timage).name;					


Das Funzt net, konvertierungsfehler.

Also, wie kriege ich dass hinn?



MFG
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 26.01.06 00:40 
Moin!

Wie ist "cool" deklariert?

cu
Narses
curtiss Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59



BeitragVerfasst: Do 26.01.06 08:38 
ausblenden Delphi-Quelltext
1:
cool : string;					


Das habe ich aber vorher auch geschrieben objektname in string.

oder was meinst du?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 26.01.06 09:23 
Moin!

Ja, das meinte ich schon; dass du geschrieben hast, in einen String, heißt ja nicht, dass du auch einen String deklariert hast... :wink:

Bleibt ja praktisch nur noch, dass Sender nicht TImage ist; check das doch mal mit if (Sender is TImage) then...

cu
Narses
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Do 26.01.06 09:53 
ausblenden Delphi-Quelltext
1:
2:
  if Sender is TComponent then Result := TComponent(Sender).Name
                          else Result := ''


sollte für alle Komponenten gehen!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
curtiss Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 59



BeitragVerfasst: Do 26.01.06 12:58 
Danke, funzt ^^