Autor Beitrag
sPeeD2k5
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72



BeitragVerfasst: Fr 02.10.09 08:48 
Folgendes Problem:

ausblenden Delphi-Quelltext
1:
dateiname := delete(string(grid.Name),0,2);					


Bei dieser Zeile bekomme ich die Fehlermeldung

[Pascal Fehler] UFunctions.pas(105): E2197 Konstantenobjekt kann nicht als Var-Parameter weitergegeben werden

Kann man den Objektnamen nicht als String verwenden?
ub60
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 764
Erhaltene Danke: 127



BeitragVerfasst: Fr 02.10.09 08:53 
Delete ist eine Prozedur und würde den Objektnamen verändern. Das geht natürlich nicht.
Probiere es mal so:
ausblenden Delphi-Quelltext
1:
2:
dateiname := grid.Name;
delete(dateiname,1,2);

ub60
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 02.10.09 09:23 
Hallo,

oder alternativ Copy verwenden:
ausblenden Delphi-Quelltext
1:
dateiname := Copy(grid.Name,3,MAXINT);					

ist auch um den Faktor 2 schneller.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )