Autor Beitrag
adler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Mo 23.08.04 21:31 
Hi!

Ich habe irgendwie ein Prob!

Einmal habe ich wie folgt die Funktion und die Variable deklariert.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
constructor ToglLabel.create(aPosition:TRect; aText: array of string);
begin
   inherited create(aPosition);
   //Setlength(MultiLineText, high(Text));
   MultiLineText := aText;  //<-- Fehler
   TexFont := TTexFont.Create(imagepath + 'font.tga');
   fontcolor.Red := 0; fontcolor.Green := 0; fontcolor.Blue := 0; fontcolor.Alpha := 1;
   fontsize := 1;
end;

ausblenden Delphi-Quelltext
1:
MultiLineText: array of string;					

Und so der Aufruf und die andere Variable.
ausblenden Delphi-Quelltext
1:
ASB_Text: array of string;					

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
vRect.Left := 300;vRect.Top := 100;vRect.Right := 280;vRect.Bottom := 80;
setlength(ASB_Text,2);
ASB_Text[0] := 'Das ist';
ASB_Text[1] := 'der Text';
submenu1_1_ASB_text := ToglLabel.create(vRect,ASB_Text);


So, das wars.
Fehler: Array und Dynamiy Array passen nicht zusammen.
Gemeint ist damit Multilinetext und aText

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Di 24.08.04 07:35 
Hallo
Definier dir einen eigenen Typ
ausblenden Delphi-Quelltext
1:
type Tmyarray=array of string;					


und dann schreibst du

ausblenden Delphi-Quelltext
1:
2:
3:
constructor ToglLabel.create(aPosition:TRect; aText: TmyArray); 
und 
MultiLineText: Tmyarray;


Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)