--  File:DINNER.adb
--
--  Description:  This file contains the main Ada-95 program
--                Generated date: 23/04/97 time is 12:21:53
--
with System ;
with Ada.Exceptions ;
with os2.jba; use os2.jba;
with DINNERDP ; use DINNERDP ;
with text_io; use text_io;
with society ;
procedure DINNER is

begin
 create(file=>society.print,name=>"dinner.prn",mode=>out_file);
 set_output(society.print);
 --   Initialize the application
put("Initialize Application");
for i in 1..society.Table_size loop
  for j in 1..3 loop
    society.WindowText(i,j) := "..................................." ;
  end loop;
end loop ;
pApp :=  GuiInvokeApplication(
          ApplicationName => "Phil",
          Title           =>  "Dinning philosophers(version by Michael B. Feldman, The George Washington University)",
          WindowClass     =>  WT_DIALOG,
          IDD_MAINFRAME   =>  IDD_FRAME,
          pwMainFrame     =>  society.wFrame'unchecked_access,
          DialogWndProc   =>  FrameWndProc'address);

GuiExitWindows ;
  exception
    when The_Error: others => new_line; put_Line (" There are some problems");
         put_Line(Ada.Exceptions.Exception_Name(The_Error));
         put_Line(Ada.Exceptions.Exception_Information(The_Error));
         put_Line(Ada.Exceptions.Exception_Message(The_Error));

end DINNER ;
