Dialog Abfrage Ja/Nein..

Script Beispiel für eine „Ja/Nein/Abbruch“ Abfrage.

program Dialog_Abfrage;
const
  MB_ICONQUESTION = $00000020;
  MB_OK = $00000000;
  MB_OKCANCEL = $00000001;
  MB_YESNOCANCEL = $00000003;
    
  MB_DEFBUTTON1 = $00000000;
  MB_DEFBUTTON2 = $00000100;
  MB_DEFBUTTON3 = $00000200;
  
  IDYES = 6; 
  IDNO = 7; 

begin

  { Beispiel:
  Application.MessageBox( 'Test', 'Frage', 
              MB_ICONQUESTION or MB_OKCANCEL or MB_DEFBUTTON2);
  }

  if (Application.MessageBox( 'Text', 'Frage', 
              MB_ICONQUESTION or MB_YESNOCANCEL or MB_DEFBUTTON2) = idYes) then
  begin
    /// ...
    writeln('You clicked yes');
  end;

end.