Autor Beitrag
Airwolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 92



BeitragVerfasst: Mi 25.02.09 21:37 
Hi Leut's,

habe nen kleines Problem.
Will bei meinem Programm überprüfen ob nen ini-File exisitiert und wenn nicht das dann anlegen. Irgendwie klappt das aber nicht so wie ich das will.

Hier mein Code:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
begin
    if FileExists('C:\paths.ini') then
  begin
  //Bla
  end

  else
    begin
      if MessageDlg('Existiert nicht. Anlegen?', mtConfirmation, [mbYes, mbNo],0) = 0 then
        begin
          iniContent:=TStringlist.Create;
          try
            iniContent.add('paths.ini');
            iniContent.SaveToFile('C:\paths.ini');
          finally
          iniContent.free;
        end;
        if FileExists('C:\paths.ini') then
          begin
            MessageDlg('Angelegt', mtInformation, [mbOK], 0);
          end
          else MessageDlg('Nicht angelegt', mtInformation, [mbOK], 0);
          end;
    end;


Kann meinem Fehler nicht finden. Könnt ihr da mal drüber schauen und mir sagen was ich falsch gemacht hab?

Ich komme bis zur Meldung dass kein File angelegt wurde, klicke auf ja, aber nix passiert, bzw. das Fenster verschwindet aber weiter passiertt nix und das file wird auch nicht angelegt?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 25.02.09 21:44 
Du hast nicht zufällig Windows Vista?


Zuletzt bearbeitet von jaenicke am Mi 25.02.09 21:48, insgesamt 3-mal bearbeitet
Airwolf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 92



BeitragVerfasst: Mi 25.02.09 21:45 
Gott sei dank nein
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 25.02.09 21:48 
Und was soll das "= 0"? Was ist die 0? Doch wohl nicht Ja, oder? Nimm bitte die entsprechenden Konstanten...
(Hier wäre das also mrYes.)

// EDIT:
user profile iconAirwolf hat folgendes geschrieben Zum zitierten Posting springen:
Gott sei dank nein
Ich hab XP nicht einmal mehr installiert, nur noch im virtuellen PC und auf einem Test-PC. ;-)
Auf den richtigen PCs nur noch Vista. ;-)
Airwolf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 92



BeitragVerfasst: Mi 25.02.09 21:52 
Ja, habs jetzt.

Hatte Yes und mbYes versucht, war aber mrYes, klar.

Danke nochmal.
Airwolf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 92



BeitragVerfasst: Mi 25.02.09 21:52 
user profile iconjaenicke hat folgendes geschrieben Zum zitierten Posting springen:

// EDIT:
user profile iconAirwolf hat folgendes geschrieben Zum zitierten Posting springen:
Gott sei dank nein
Ich hab XP nicht einmal mehr installiert, nur noch im virtuellen PC und auf einem Test-PC. ;-)
Auf den richtigen PCs nur noch Vista. ;-)


Naja, ist halt Geschmackssache :D
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 25.02.09 22:03 
user profile iconAirwolf hat folgendes geschrieben Zum zitierten Posting springen:
Ja, habs jetzt.

Hatte Yes und mbYes versucht, war aber mrYes, klar.
Siehe in der Hilfe, da steht eine Liste der Buttons und deren Rückgabewerte...
docs.codegear.com/do...Buttons@Longint.html