Forms Delphi

FUNCTION ProgrammExit(Text:STRING):BOOLEAN;
BEGIN
RESULT:=MessageDlg(Text,mtConfirmation,[mbYes,mbNo],0)=mrYes;
END;
(*
Kullanimi
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
CanClose:=ProgrammExit('Kapatmakmi istiyorsunuz?');
end;
*)