Czołem Bracia w kodzie
Pomóżcie mi zrozumieć jak naprawić poniższy kod
[Code]
var
recent : TStringList;//to jak rozumiem paskalowy odpowiednik zmiennej globalnej z C/C++
//this procedure reads keys from previous installation file setup.ini and stores them in variables
procedure SaveSetupINIData();
var
path : String;
file : TStringList;
cnt : Integer;
begin
path := BattletechDataDir('');
if DirExists(path) then
begin
file := TStringList.Create();
file.LoadFromFile(ExpandConstant('{app}') + '\setup.ini');
//find recent section
cnt := file.indexOf('[RecentFiles]');
if cnt > -1 then
//if there is recent files section store each entry which starts with 'recent\'
begin
//recent.Create();
for cnt := cnt to file.Count-1 do
begin
if (Pos('recent\', file[cnt]) > 0) then
begin
recent.Add(file[cnt]);
end;
end;
end;
file.Free();
end;
end;
Jak uruchamiam instalator dostaję w twarz Null Pointer Exception w linii 29; ok, rozumiem, obiekt nie jest stworzony. Ale po odkomentowaniu linii 24 wyskakuje 'Could not call proc', i tutaj to już nie wiem co jest nie tak.