Сделал пример но выдает ошибку в строке
Где я глючу? Код примера
| Код | unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DB, DBTables, Grids, DBGrids;
type TMember = record Counter : String[11]; C_Code : String[3]; N_Code : String[2]; DataSkl : String[10]; ProtNum : String[6]; FamN : String[20]; D_Code : String[2]; Pos_Node: String[2]; ST_Code : String[5]; Pov_Code: String[1]; DataV : String[10]; FamS : String[20]; NameS : String[14]; SonameS : String[19]; DataBD : String[10]; ObjName : String[22]; NamePos : String[22]; Pos_Code: String[1]; PRO_Code: String[2]; NameRoz : String[20]; Nap_Code: String[1]; RI_Code : String[2]; DataRi : String[10]; PostN : String[3]; SumR : String[3]; SumK : String[2]; UData : String[10]; UNData : String[10]; UUData : String[10]; SKN_Code: String[1]; SKP_Code: String[1]; SS_Code : String[1]; NPR_Code: String[1]; PZ_Code : String[1]; SVS_Code: String[1]; KZap : String[20]; KZData : String[10]; PError : String[1]; SF : String[1]; end; type TForm1 = class(TForm) ReadButton: TButton; SaveButton: TButton; DataSource1: TDataSource; DBGrid1: TDBGrid; Table: TTable; StringGrid1: TStringGrid; procedure ReadButtonClick(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1; r: array of TMember;
implementation
{$R *.dfm}
procedure TForm1.ReadButtonClick(Sender: TObject); var f: File of TMember; i:integer; begin AssignFile(f, '20.kap'); Reset(f); try i:=0; while not Eof(f) do begin Read(f, r[i]); // work with record StringGrid1.Cells[0,i]:=r[i].counter; StringGrid1.Cells[1,i]:=r[i].C_Code; StringGrid1.Cells[1,i]:=r[i].N_Code; i:=i+1; end; finally CloseFile(f); end; end; end.
|
|