Autor Beitrag
Darkpara
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Mo 14.08.06 18:20 
hallo,

ich stehe vor dem nächten problem, folgendes: das memo kann ich nun mit dem findcomponent aussuchen, nur möchte ich nun das geiche mit meinen arrays machen

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var textfin1, textfin2, textfin3, textfin4, textfin5, textfin6, textfin7  : array[0..10] of string;

    x:= 1;
    TMemo(FindComponent('memo'+IntToStr(x))).Text := '';
    for i := 1 to 10 - 1 do
    TMemo(FindComponent('Memo'+IntToStr(x))).Text := ''+TMemo(FindComponent('memo'+IntToStr 
    (x))).text+' '+textfin[x][i]+''+#13#10+'' ;

also nun möchte ich das +textfin[x][i]+ mit 2 variabeln versehen können mit x und mit i
etwas in dem styl müsste das geben nur geht das nicht:

ausblenden Delphi-Quelltext
1:
FindComponent('textfin'+IntToStr(x)+'[i]')					


danke im voraus :)

Moderiert von user profile iconGausi: Delphi-Tags hinzugefügt
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 14.08.06 18:25 
Da kommst du mit FindComponent nicht weiter. Aber mit einem 2-Dimensionalem Array:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var textfin : Array [1..7][1..10] of string;

...

textfin[1][3] := 'Hallo';

_________________
We are, we were and will not be.
Darkpara Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Mo 14.08.06 18:27 
och das geht auch? is ja cool danke dir :) mit dem krig ichs hin :D
Darkpara Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Mo 14.08.06 18:32 
ps: richtige syntax : var textfin : Array [1..7] of Array [1..10] of string;
Jakob Schöttl
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 929
Erhaltene Danke: 1


Delphi 7 Professional
BeitragVerfasst: Mo 14.08.06 18:57 
Das geht aber auch so, wie gausi es geschrieben hat, bei mehrdimensionalen Arrays:
beispiele für dreidimensionale Arrays:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
var RaumPunkt: Array [AMin..AMax] of Array [AMin..AMax] of Array [AMin..AMax] of TPoint;
    //oder
    RaumPunkt: Array [AMin..AMax,AMin..AMax,AMin..AMax] of TPoint;
    
    //das geht nicht:
    RaumPunkt: Array [AMin..AMax][AMin..AMax][AMin..AMax] of TPoint;


Zuletzt bearbeitet von Jakob Schöttl am Di 15.08.06 08:54, insgesamt 1-mal bearbeitet
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mo 14.08.06 19:23 
user profile iconDarkpara hat folgendes geschrieben:
ps: richtige syntax : var textfin : Array [1..7] of Array [1..10] of string;

Hehe, Gausi hat nen Fehler gemacht :mrgreen:
Du hast natürlich Recht, deine Syntax ist richtig.

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 14.08.06 19:38 
user profile iconJayEff hat folgendes geschrieben:
Hehe, Gausi hat nen Fehler gemacht :mrgreen:
Ja nu, was soll ich jetzt darauf sagen? Bin ich Jesus? Wächst mir Gras aus der Nase? :nixweiss:

;-)

_________________
We are, we were and will not be.
Darkpara Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 61

Win XP

BeitragVerfasst: Mo 14.08.06 20:03 
ging ja auch nur darum das wenn wer anderes das liest nicht wie ich noch 10min nach dem syntax suchen muss :) :)
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: Mo 14.08.06 20:42 
Aber.. Aber.. Got... ähhh Gausi .. Ich dachte immer ... :'(
OK zuviel OT ich weis... ich lass es ab jetzt >.>

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.