![]() |
string[]-Problem
Hallo,
ich will einen String ungefähr so zusammen bauen: :coder:
Delphi-Quellcode:
Wenn ich nun aber das Programm teste, zeigt das Label nichts an. Was mache ich falsch? :?:
procedure TForm1.Button1Click(Sender: TObject);
var wort: string[5]; begin wort[1]:= 'h'; wort[2]:= 'a'; wort[3]:= 'l'; wort[4]:= 'l'; wort[5]:= 'o'; label1.Caption:= wort; end; |
Re: string[]-Problem
Probiers mal so:
Delphi-Quellcode:
var wort: string[5];
begin wort[1]:= 'h'; wort[2]:= 'a'; wort[3]:= 'l'; wort[4]:= 'l'; wort[5]:= 'o'; label1.SetTextBuf(nil); label1.SetTextBuf(@wort[1]); end; |
Re: string[]-Problem
[edit]gelöscht, weil Unsinn![/edit]
|
Re: string[]-Problem
wie er zeigt bei dir nichts an?
Wenn ich die procedure so benutze ist label1.caption hallol÷ |
Re: string[]-Problem
Wenn du string[6] nimmst, dann geht's. Aber frag mich bitte nicht wieso, vielleicht muss ans Ende, wie beim Char etwas angehängt werden. :oops:
|
Re: string[]-Problem
Zitat:
[edit] Was für ein Sinn hat das eigentlich? [/edit] |
Re: string[]-Problem
in wort[0] muss die momentan genutze Länge stehen (als "char")=> "wort[0]:=#5;"
|
Re: string[]-Problem
Zitat:
Delphi-Quellcode:
[edit]So funktionierts ebenfalls![/edit]
in wort[0] muss die momentan genutze Länge stehen (als "char")=> "wort[0]:=#5;"
|
Re: string[]-Problem
Mit meiner Methode (siehe oben) gehts auch.
|
Re: string[]-Problem
Zitat:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:40 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz