Registriert seit: 16. Feb 2006
444 Beiträge
Delphi 11 Alexandria
|
Function optimieren
21. Mär 2007, 11:40
kann man dieses optimieren bzw. kürzen?
Delphi-Quellcode:
r := '45_78_754#9254_486_715';
p1 := Pos('_', r);
t := Copy(r, p1 + 1, Length(r));
s1 := Copy(r, 0, p1 - 1);
p1 := Pos('_', t);
t2 := Copy(t, p1 + 1, Length(t));
s2 := Copy(t, 0, p1 - 1);
p1 := Pos('#', t2);
t := Copy(t2, p1 + 1, Length(t2));
s3 := Copy(t2, 0, p1 - 1);
p1 := Pos('_', t);
t2 := Copy(t, p1 + 1, Length(t));
s4 := Copy(t, 0, p1 - 1);
p1 := Pos('_', t2);
t := Copy(t2, p1 + 1, Length(t2));
s5 := Copy(t2, 0, p1 - 1);
rs := Format('%s.%s.%s %s:%s:%s', [s1, s2, s3, s4, s5, t]);
Doreen Gruss Doreen
|
|
Zitat
|