unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Grids, StdCtrls,
ComCtrls;
type
TDemographics = record
Population, PopulationDensity, EthnicGroups, Languages, Religions,
UrbanizationRate, LiteracyRate: string;
end;
TEconomy = record
GDP, MajorIndustries, Currency, UnemploymentRate, InflationRate: string;
end;
TCulture = record
NationalHolidays, TraditionalFoods, ArtsAndMusic, Sports, Clothing: string;
end;
TGovernment = record
GovernmentType, HeadOfState, HeadOfGovernment, AdministrativeDivisions, IndependenceDate: string;
end;
TGeography = record
Area, Borders, HighestPoint, MajorRivers, Climate: string;
end;
TInfrastructure = record
Transportation, InternetPenetration, ElectricityAccess, WaterAccess, MobileCoverage: string;
end;
TCountry = record
Name, OfficialName, CapitalCity, Region, PhoneCode, FlagEmoji: string;
Demographics: TDemographics;
Economy: TEconomy;
Culture: TCulture;
Government: TGovernment;
Geography: TGeography;
Infrastructure: TInfrastructure;
end;
{ TForm1 }
TForm1 = class(TForm)
memoOverview: TMemo;
memoInfrastructure: TMemo;
memoGeography: TMemo;
memoGovernment: TMemo;
memoCulture: TMemo;
memoEconomy: TMemo;
memoDemographics: TMemo;
PageControl1: TPageControl;
sgCountries: TStringGrid;
tabCulture: TTabSheet;
tabDemographics: TTabSheet;
tabEconomy: TTabSheet;
tabGeography: TTabSheet;
tabGovernment: TTabSheet;
tabInfrastructure: TTabSheet;
tabOverview: TTabSheet;
procedure FormCreate(Sender: TObject);
procedure sgCountriesClick(Sender: TObject);
private
procedure FillCountryData;
procedure ShowCountryDetails(const C: TCountry);
public
end;
var
Form1: TForm1;
Countries: array of TCountry;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.FormCreate(Sender: TObject);
begin
// Configure StringGrid
sgCountries.RowCount := 3;
sgCountries.ColCount := 6;
sgCountries.FixedRows := 1;
sgCountries.Cells[0, 0] := 'Name';
sgCountries.Cells[1, 0] := 'Official Name';
sgCountries.Cells[2, 0] := 'Capital';
sgCountries.Cells[3, 0] := 'Region';
sgCountries.Cells[4, 0] := 'Phone Code';
sgCountries.Cells[5, 0] := 'Flag';
// Add Afghanistan
sgCountries.Cells[0, 1] := 'Afghanistan';
sgCountries.Cells[1, 1] := 'Islamic Emirate of Afghanistan';
sgCountries.Cells[2, 1] := 'Kabul';
sgCountries.Cells[3, 1] := 'Asia';
sgCountries.Cells[4, 1] := '+93';
sgCountries.Cells[5, 1] := '🇦🇫';
// Add Albania
sgCountries.Cells[0, 2] := 'Albania';
sgCountries.Cells[1, 2] := 'Republic of Albania';
sgCountries.Cells[2, 2] := 'Tirana';
sgCountries.Cells[3, 2] := 'Europe';
sgCountries.Cells[4, 2] := '+355';
sgCountries.Cells[5, 2] := '🇦🇱';
sgCountries.AutoSizeColumns;
FillCountryData;
end;
procedure TForm1.sgCountriesClick(Sender: TObject);
var
CountryName: string;
SelectedRow: Integer;
begin
SelectedRow := sgCountries.Row;
CountryName := sgCountries.Cells[0, SelectedRow];
writeln(SelectedRow);
writeln(CountryName);
ShowCountryDetails(Countries[SelectedRow]);
end;
procedure TForm1.FillCountryData;
begin
SetLength(Countries, 1);
with Countries[0] do
begin
Name := 'Afghanistan';
OfficialName := 'Islamic Emirate of Afghanistan';
CapitalCity := 'Kabul';
Region := 'Asia';
PhoneCode := '+93';
FlagEmoji := '🇦🇫';
with Demographics do
begin
Population := '~41 million';
PopulationDensity := '~63/km²';
EthnicGroups := 'Pashtun, Tajik, Hazara, Uzbek, etc.';
Languages := 'Pashto, Dari';
Religions := 'Sunni Islam (~85%), Shia Islam (~15%)';
UrbanizationRate := '~26%';
LiteracyRate := '~38%';
end;
with Economy do
begin
GDP := '$20 billion';
MajorIndustries := 'Agriculture, textiles, mining';
Currency := 'Afghani (AFN)';
UnemploymentRate := '~11%';
InflationRate := '~5.6%';
end;
with Culture do
begin
NationalHolidays := 'Nowruz, Independence Day';
TraditionalFoods := 'Kabuli Pulao, Mantu';
ArtsAndMusic := 'Poetry, Rubab music';
Sports := 'Buzkashi, Cricket';
Clothing := 'Perahan Tunban, Chador';
end;
with Government do
begin
GovernmentType := 'Islamic Emirate';
HeadOfState := 'Hibatullah Akhundzada';
HeadOfGovernment := 'Hasan Akhund';
AdministrativeDivisions := '34 provinces';
IndependenceDate := 'August 19, 1919';
end;
with Geography do
begin
Area := '652,230 km²';
Borders := 'Iran, Pakistan, China, etc.';
HighestPoint := 'Noshaq (7,492 m)';
MajorRivers := 'Helmand, Kabul';
Climate := 'Arid, semi-arid';
end;
with Infrastructure do
begin
Transportation := 'Few paved roads, limited rail';
InternetPenetration := '~18%';
ElectricityAccess := '~70% (urban)';
WaterAccess := '~64%';
MobileCoverage := '~89%';
end;
end;
end;
procedure TForm1.ShowCountryDetails(const C: TCountry);
var
CountryName: string;
SelectedRow: Integer;
begin
SelectedRow := sgCountries.Row;
CountryName := sgCountries.Cells[0, SelectedRow];
writeln(SelectedRow);
writeln(CountryName);
if CountryName = 'Afghanistan' then
begin
MemoOverview.Text :=
'Country Name : Afghanistan' + LineEnding +
'Official Name : Islamic Republic of Afghanistan' + LineEnding +
'Flag : 🇦🇫' + LineEnding +
'ISO Codes : ISO 3166-1: AF / AFG' + LineEnding +
'Capital City : Kabul' + LineEnding +
'Continent/Region : Asia / Southern Asia' + LineEnding +
'Country Code (Phone): +93' + LineEnding +
'Currency : Afghan Afghani (AFN)' + LineEnding +
'Time Zone(s) : UTC+4:30' + LineEnding +
'Driving Side : Right' + LineEnding +
'Major Cities : Kabul, Kandahar, Herat, Mazar-i-Sharif, Jalalabad';
memoDemographics.Text :=
'Population : ~40 million' + sLineBreak +
'Density : ~60 people per km²' + sLineBreak +
'Ethnic Groups: Pashtun, Tajik, Hazara, Uzbek, others' + sLineBreak +
'Languages : Dari (Persian), Pashto (both official)' + sLineBreak +
'Religions : Islam (mostly Sunni, some Shia)' + sLineBreak +
'Urbanization : ~25%' + sLineBreak +
'Literacy Rate: ~37% (higher among males)';
memoEconomy.Text :=
'GDP: ~$20 billion USD (nominal)' + sLineBreak +
'Industries: Agriculture, mining, carpets, small-scale manufacturing' + sLineBreak +
'Currency: Afghan Afghani (AFN)' + sLineBreak +
'Unemployment: ~30–40%' + sLineBreak +
'Inflation: Varies, ~5–10%';
memoCulture.Text :=
'Holidays: Independence Day (August 19), Nowruz (Persian New Year)' + sLineBreak +
'Foods: Kabuli pulao, mantu, bolani, kebabs' + sLineBreak +
'Arts: Poetry, music, carpet weaving, miniature painting' + sLineBreak +
'Sports: Cricket, football, buzkashi (traditional horseback sport)' + sLineBreak +
'Clothing: Traditional attire like perahan tunban, chador';
memoGovernment.Text :=
'Type: De facto Islamic Emirate (Taliban control); formerly republic' + sLineBreak +
'Head of State: Hibatullah Akhundzada (Taliban leader)' + sLineBreak +
'Head of Gov: Hasan Akhund (Acting PM, Taliban)' + sLineBreak +
'Divisions: 34 provinces (wilayat)' + sLineBreak +
'Independence: August 19, 1919 (from British influence)';
memoGeography.Text :=
'Area: ~652,860 km²' + sLineBreak +
'Borders: Pakistan, Iran, Turkmenistan, Uzbekistan, Tajikistan, China' + sLineBreak +
'Highest Point: Noshaq (7,492 m)' + sLineBreak +
'Rivers: Amu Darya, Kabul River, Helmand River' + sLineBreak +
'Climate: Arid to semi-arid; hot summers, cold winters';
memoInfrastructure.Text :=
'Transport: Limited road/rail networks, major projects under development' + sLineBreak +
'Internet: Low (~15–20% penetration)' + sLineBreak +
'Electricity: ~70% access, with regional variation' + sLineBreak +
'Water: ~55% access to clean water' + sLineBreak +
'Mobile: ~90% coverage, depending on region';
end
else if CountryName = 'Albania' then
begin
MemoOverview.Text :=
'Country Name : Albania' + LineEnding +
'Official Name : Republic of Albania' + LineEnding +
'Flag : 🇦🇱' + LineEnding +
'ISO Codes : ISO 3166-1: AL / ALB' + LineEnding +
'Capital City : Tirana' + LineEnding +
'Continent/Region : Europe / Southern Europe' + LineEnding +
'Country Code (Phone): +355' + LineEnding +
'Currency : Albanian Lek (ALL)' + LineEnding +
'Time Zone(s) : UTC+1 (Standard), UTC+2 (DST)' + LineEnding +
'Driving Side : Right' + LineEnding +
'Major Cities : Tirana, Durrës, Vlorë, Shkodër, Elbasan';
memoDemographics.Text :=
'Population : ~2.8 million' + sLineBreak +
'Density : ~100 people per km²' + sLineBreak +
'Ethnic Groups: Albanian (~98%), Greek, others' + sLineBreak +
'Languages : Albanian (official), Greek, others' + sLineBreak +
'Religions : Islam, Christianity (Orthodox & Catholic), others' + sLineBreak +
'Urbanization : ~60%' + sLineBreak +
'Literacy Rate: ~98%';
memoEconomy.Text :=
'GDP: ~$18 billion USD' + sLineBreak +
'Industries: Agriculture, energy, tourism, textiles, mining' + sLineBreak +
'Currency: Albanian Lek (ALL)' + sLineBreak +
'Unemployment: ~11%' + sLineBreak +
'Inflation: ~3.5%';
memoCulture.Text :=
'Holidays: Independence Day (Nov 28), Liberation Day (Nov 29)' + sLineBreak +
'Foods: Tavë kosi, byrek, qofte' + sLineBreak +
'Arts: Folk music, iso-polyphony, modern art' + sLineBreak +
'Sports: Football (soccer), basketball, weightlifting' + sLineBreak +
'Clothing: Traditional dress includes xhubleta, fustanella';
memoGovernment.Text :=
'Type: Parliamentary republic' + sLineBreak +
'Head of State: President Bajram Begaj' + sLineBreak +
'Head of Gov: Prime Minister Edi Rama' + sLineBreak +
'Divisions: 12 counties (qarqe)' + sLineBreak +
'Independence: November 28, 1912';
memoGeography.Text :=
'Area: ~28,748 km²' + sLineBreak +
'Borders: Montenegro, Kosovo, North Macedonia, Greece' + sLineBreak +
'Highest Point: Mount Korab (2,764 m)' + sLineBreak +
'Rivers: Drin, Seman, Vjosa' + sLineBreak +
'Climate: Mediterranean; mild, wet winters and hot, dry summers';
memoInfrastructure.Text :=
'Transport: Roads improving, limited rail, major ports in Durrës and Vlorë' + sLineBreak +
'Internet: ~75% penetration' + sLineBreak +
'Electricity: ~100% access' + sLineBreak +
'Water: ~95% access to clean water' + sLineBreak +
'Mobile: ~95% coverage';
end;
end;
end.