Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- //Declare countryrecord
- TCountry= record
- Country: string [20];
- Capital: string [20];
- Population:integer;
- end;
- var countryarray : array [1..3] of TCountry;
- Var CountryRecord:array[1..3] of TCountry;
- procedure TForm1.Button1Click(Sender: TObject);
- var counter:integer;
- begin
- for counter:=1 to 3 do
- begin
- with CountryRecord[counter] do
- Begin
- Country:=inputbox('Country','Enter country name','');
- Capital:=inputbox('Capital','Enter capital name','');
- Population:=StrToInt(InputBox('Population','Enter population',''));
- end;//with
- end;//for
- end; // Button1
- procedure TForm1.Button2Click(Sender: TObject);
- var counter:integer;
- begin
- for counter:= 1 to 5 do
- begin
- with countryrecord[counter] do
- begin
- form1.memo1.lines.add(country);
- form1.memo1.lines.add(capital);
- form1.memo1.lines.add(inttostr(population));
- form1.memo1.lines.add(' ');
- end;//with
- end;//for
- end;//button
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement