Autor Beitrag
AcidBurnX
Hält's aus hier
Beiträge: 3



BeitragVerfasst: Di 06.05.03 11:26 
Hi!

Wie kann ich den Text eines Edit-Controls auf ein Char-Array zuweisen?

Beispiel:

ausblenden Quelltext
1:
2:
3:
4:
strTemp: array [1..256] of char;

{ Funktioniert natuerlich nicht }
strTemp := Edit1.Text;



Danke im Voraus
AcidBurnX
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Di 06.05.03 12:25 
ausblenden Quelltext
1:
2:
3:
4:
strTemp[1]:= Edit1.text
// geht auch in schleife 
//dann eben
for i:=0 to 256 do begin

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Di 06.05.03 13:04 
Hi!

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
var strTemp : Array of Char;
begin
  SetLength(strTemp,Length(edit1.text));
  for i:=1 to Length(edit1.text) do
    strTemp[i-1]:=edit1.text[i];
end;


@foxy: ich verstehe Deinen Code nicht ganz!

MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Di 06.05.03 13:04 
foxy hat folgendes geschrieben:
ausblenden Quelltext
1:
strTemp[1]:= Edit1.text					

Wird IMHO nicht funzen, da strTemp[1] ein Char ist und Edit1.Text ein String! Aber schau dir mal StrCopy/StrPCopy an...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!