ďťż

Ładny brzuch

type Twpis_f=array of char; var stringgrid_file_inf : record kolumna:Integer; wiersz:Integer; size:Integer; end; plik:File; aCol,aRow,el:Integer; wpis_stringgrid:string; wpis_f:Twpis_f; function ArrayChar_string(tekst:Twpis_f):string; var i:Integer; begin Result:=''; for i:=0 to High(tekst) do Result:=Result+tekst[i]; end; begin for aCol:=0 to stringgrid.ColCount-1 do for aRow:=0 to stringgrid.RowCount-1 do stringgrid.Cells[aCol,aRow]:=''; AssignFile(plik, 'plik.txt'); Reset(plik,1); try while not Eof(plik) do begin BlockRead(plik,stringgrid_file_inf,SizeOf(stringgrid_file_inf)); SetLength(wpis_f,stringgrid_file_inf.size); BlockRead(plik,wpis_f[0],stringgrid_file_inf.size); if stringgrid_file_inf.kolumna>stringgrid.ColCount-1 then stringgrid.ColCount:=stringgrid_file_inf.kolumna+1; if stringgrid_file_inf.wiersz>stringgrid.RowCount-1 then stringgrid.RowCount:=stringgrid_file_inf.wiersz+1; stringgrid.Cells[stringgrid_file_inf.kolumna,stringgrid_file_inf.wiersz]:=ArrayChar_string( wpis_f); end; finally CloseFile(plik); end; end;

Jest to kod który wczytuje zawartość pliku plik.txt do stringgrida. Nie wiem gdzie jest błąd, bo po wczytaniu zawartości pliku wyskakuje mi 'Range Check Error', dlatego prosze zebyscie to przeglądnęli i moze dopatrzycie sie jakiegos przekroczenia zakresu, bo mnie juz zabrakło pomysłów co z tym może byc nie tak.

  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • zsf.htw.pl
  •