Hi!
Ich habe ein Problem und zwar: Wenn ich diesen code ausführe:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11:
| mapslist := TStringlist.create; mapslist.loadfromfile('mapslist.txt'); for l:=0 to mapslist.Count-1 do if mapslist.strings[l] <> '' then writeln(mapslist.strings[l]); begin if mapslist.strings[l] = RefreshMsg.MapName then nextmap := mapslist.Strings[l]; if nextmap = '' then nextmap := mapslist.Strings[0]; end; |
,
dann erhalte ich den error: '... überschreitet Maximum (2) ...'. Nun ist es aber so, dass die mapslist.txt nur zwei Einträge enthält (also Zeile 0 und Zeile 1). Mapslist.count sollte also 2 ausgeben, wovon aber von sich aus gleich einer abgezogen wird.
Meine Frage: Wo steckt der Fehler?
MfG Nabbl.