Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. type
  2. //Declare countryrecord
  3. TCountry= record
  4. Country: string [20];
  5. Capital: string [20];
  6. Population:integer;
  7. end;
  8.  
  9. var countryarray : array [1..3] of TCountry;
  10.  
  11. Var CountryRecord:array[1..3] of TCountry;
  12.  
  13.  
  14. procedure TForm1.Button1Click(Sender: TObject);
  15. var counter:integer;
  16. begin
  17. for counter:=1 to 3 do
  18. begin
  19. with CountryRecord[counter] do
  20. Begin
  21. Country:=inputbox('Country','Enter country name','');
  22. Capital:=inputbox('Capital','Enter capital name','');
  23. Population:=StrToInt(InputBox('Population','Enter population',''));
  24. end;//with
  25. end;//for
  26. end; // Button1
  27.  
  28. procedure TForm1.Button2Click(Sender: TObject);
  29. var counter:integer;
  30. begin
  31. for counter:= 1 to 5 do
  32. begin
  33. with countryrecord[counter] do
  34. begin
  35. form1.memo1.lines.add(country);
  36. form1.memo1.lines.add(capital);
  37. form1.memo1.lines.add(inttostr(population));
  38. form1.memo1.lines.add(' ');
  39. end;//with
  40. end;//for
  41. end;//button
  42.  
  43. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement