I check when the program is loaded for the existence of a file. But I can not understand how to make sure that if there is no file, the program is closed. And if there is continued work. I did this but the program and so and so close tell me what's wrong.
procedure TForm1.FormCreate(Sender: TObject); var fileName: string; begin fileName := 'D:\rec\Project2.dll'; if FileExists(fileName) then ShowMessage(fileName+' prodolgit!') else begin ShowMessage(fileName+' file ne najden prog zakroetsja!'); Form1.Close; end; end;