Autor Beitrag
rhodan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28



BeitragVerfasst: Di 18.10.05 16:37 
Moin Moin,

hab ein ziemliches (def. letztes :wink: ) problem mit meiner Listbox, wäre supernett wenn sich jemand das mal ansehen würde:

www.delphipraxis.net...st443583.html#443583

Danke und Grüße aus Hamburg

Rhodan
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Di 18.10.05 16:57 
Bitte beschreibe Dein Problem hier, wenn Du hier eine Antwort willst!

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
rhodan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28



BeitragVerfasst: Di 18.10.05 21:24 
tut mir leid, aber ich wollte nicht Crossposten :?

letztes mal hab ich ne andere frage 2 x gestellt in 2 versch. foren. und das war anscheinend auch nicht ok :oops: sorry

mein Problem ist folgendes:

ich lade rankinglisten in mein grid, aus diesem werden die einträge automatisch in eine Listbox geladen. das problem ist, das ich die Zeilen der listbox einfach nicht variabel bekomme, ich also keine leerzeilen am ende der listbox habe.

die listbox hat immer genau soviele zeilen wie ich in

Sarr: Array [0..3000] of strings; definiere, in diesem fall 3000. dies ist der code mit dem ich die einträge meiner listbox (aus dem grid) lade:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
var 
iRow: integer; 
  sPrev, sCurr: string; 
  datei : TextFile; 
  dateiname : String; 
  zeile : String; 
  inhalt : String; 
  perslist : Sarr; 
  pers : Sarr; 
  i, j : integer; 
  begin 
etc etc.......... 


listbox1.Clear; 
   for iRow := 1 to length(perslist) do 
    begin 
    sCurr := StringGrid1.Cells[CI_ACCT, iRow]; 
    if sCurr <> sPrev then 
    begin 
      if iRow > 1 then 
      listbox1.items.Add(''); 
      listbox1.items.Add(sCurr); 
      listbox1.items.Add(StringOfChar('-', 10)); 
      sPrev := sCurr; 
    end; 
    listbox1.items.Add(StringGrid1.Cells[CI_NAME, iRow]); 
  end; 
dateiname := ('rankinglist.htm'); 
  AssignFile(datei, dateiname); 
  reset(datei); 
  inhalt := ''; 
  repeat 
    Readln(datei, zeile); 
    inhalt := inhalt + zeile; 
  until eof(datei); 
  CloseFile(datei); 
  inhalt := getTable(inhalt); 
  perslist := getEntries(inhalt); 

  i := 0; 
  while (perslist[i] <> '') do 
  begin 
    pers := processAccount(perslist[i]); 
    for j := 0 to 11 do 
    begin 
      Stringgrid1.cells[j+1,i+1]:=pers[j]; 
    end; 
    inc(i); 
  end; 
reloadtable.Enabled := true; 
      reloadhtml.Enabled := true; 
end; 
end; 
end;


ich bin mir ziemlich sicher das der fehler in dieser zeile liegt:

for iRow := 1 to length(perslist) do.

wäre nett wenn mir dabei helfen könnte.

Gruß Rhodan
rhodan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 28



BeitragVerfasst: Do 20.10.05 00:12 
ok habs endlich gelöst. habs auf nem anderen weg geschafft.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var 
Q: integer; 

begin 
for Q := listbox1.Items.Count - 1 downto 0 do 
begin 
if listbox1.Items[listbox1.Items.Count-1]='' then 
listbox1.Items.Delete(listbox1.Items.Count-1); 
end; 
end;




und dafür hab ich 4 nächte gebraucht :autsch:

Grüße aus Hamburg,

Rhodan