Entwickler-Ecke

Sonstiges (Delphi) - Bestimmter Teil eines Labels rausschneiden


tmkb - Mi 15.01.03 16:10
Titel: Bestimmter Teil eines Labels rausschneiden
Hallo,

Ich habe folgendes in einem Label:

Quelltext
1:
wort1=wort2                    


Kann mir jemand kurz sagen, wie ich jetzt "wort1" in das label2 schreibe und "wort2" ins label3.
Danke für Hilfe!
tmkb


Savage - Mi 15.01.03 16:24

Hi,
das funktioniert mit den Funktionen copy und pos.

Also wenn label1.caption = 'wort1=wort2' ist, denn müsste es in etwa so funktionieren:


Quelltext
1:
2:
3:
4:
5:
6:
var s : String;
...
s := label1.caption;
label2.caption := copy(s, 1, pos('=',s) - 1 );
label3.caption := copy(s, pos('=',s)+1, length(s)-pos('=',s) );
...


MfG
Savage


tmkb - Mi 15.01.03 17:14

danke, hat geklappt!