var

F1, F2, S : String;
I: integer;

begin

if not FileExists( AppPath +'LastFiles.ini' ) = true then exit;

repeat;

I := I + 1;
F1 := IniReadStr( AppPath +'LastFiles.ini', 'LastFiles', 'File'+IntToStr(I), '' );
S := IniReadStr( AppPath +'LastFiles.ini', 'LastFiles', 'Num', '' );
FileOpenA( F1 );

until IntToStr(I) = S;

F2 := IniReadStr( AppPath +'LastFiles.ini', 'LastWindow', 'Current', '' );
FileOpenA( F2 );

end.