Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit Unit1;
- interface
- uses
- Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
- Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Grids;
- type
- TPerson = record
- Name: string;
- Age: Integer;
- end;
- TForm1 = class(TForm)
- StringGrid1: TStringGrid;
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- Form1: TForm1;
- implementation
- {$R *.dfm}
- procedure TForm1.FormCreate(Sender: TObject);
- var
- People: array[1..3] of TPerson;
- I: Integer;
- begin
- People[1].Name := 'Denis';
- People[1].Age := 228;
- People[2].Name := 'Anya';
- People[2].Age := 1337;
- People[3].Name := 'Liza';
- People[3].Age := 1488;
- for I := 1 to 3 do
- begin
- StringGrid1.Cells[0, I - 1] := People[I].Name;
- StringGrid1.Cells[1, I - 1] := IntToStr(People[I].Age);
- end;
- // StringGrid1.Cells[1, 0] := 'Hello';
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement