Autor Beitrag
sventestic
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 20

WIN XP
Delphi 6, Html
BeitragVerfasst: Fr 06.10.06 16:43 
Hi Leute ich hab folgendes Problem. Ich wollte nur fragen ob einer von euch weis warum der compiler ein Problem damit hat eine zeile aus meinem Dynamischen Array in einen string zu wandeln?

Fals das als problembeschreibung nicht reicht zeig ich euch mal mein probeprogramm.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.FormCreate(Sender: TObject);
var a:Array of string;
 st:string;
 i,j,g:byte;
begin
 setlength(a,3);
 a[1]:='face';
 a[2]:='face lol';
 a[3]:='lol face';
for i:=1 to 3 do
 begin
  st:=a[i];
 for g:=0 to length(st)do
  if (st[g]='f') and (st[g+1]='a') then
   inc(j);
 end;
label1.caption:=floattostr(j);
end;
end.
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Fr 06.10.06 17:57 
Ja, weiss ich. Du setzt die Länge auf 3 (Elemente), das sind die Indizes 0..2 und *nicht * 1..3.

_________________
Na denn, dann. Bis dann, denn.
gsmgrufti
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 22


Delphi 7 Prof, BDS2006 rof
BeitragVerfasst: Fr 06.10.06 17:58 
Weils bei 0 losgeht

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
setlength(a,3);
 a[0]:='face';
 a[1]:='face lol';
 a[2]:='lol face';
for i:=0 to 2 do


Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt