Autor Beitrag
Henry
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 619

WinXP Prof. SP3
D6 Prof.
BeitragVerfasst: So 11.05.03 12:40 
Hallo,

ich würde gern wissen wie ich Folgender Variable einen String zuweisen kann

ausblenden Quelltext
1:
Product  : Array[0..40] of Char;					


mit z.B.
ausblenden Quelltext
1:
Product := Edit1.Text;					

Geht es ja nicht.

Giebt es da eine Möglichkeit?

_________________
mfg Henry
Alibi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 458

Win2K SP3
Delphi 6 Ent
BeitragVerfasst: So 11.05.03 13:14 
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
var
  i: integer;
begin
  for i := 1 to length(Edit123.Text) do
    Produkt[i-1] := Edit123.Text[i];
end;
AndyB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1173
Erhaltene Danke: 14


RAD Studio XE2
BeitragVerfasst: So 11.05.03 13:17 
Natürlich.

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
function SetPChar(Dest: PChar; const Source: string; MaxLen: Integer): PChar;
begin
  Result := StrLCopy(Dest, PChar(Source), MaxLen);
end;

var
  a: array[0..40] of Char;

SetPChar(a, Edit1.Text, High(a));

_________________
Ist Zeit wirklich Geld?
Henry Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 619

WinXP Prof. SP3
D6 Prof.
BeitragVerfasst: So 11.05.03 16:03 
Danke,

hat super funktioniert.

_________________
mfg Henry