-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Hab die Geschichte mit der .ini am Ende der procedure gesetzt und jetzt funkt alles, aber wirklich alles. :dancer2:
Thx noch mal. :thumb:
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Hab das Programm noch mal gestartet, ohne Code zu ändern, und es wird auf einmal nix erstellt, nicht die ini und nicht der Ordner, jetzt verstehe ich garnix. :wall:
Aber danke dir, ich gucke mal jetzt weiter.
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Aaaaaa jetzt verstehe ich, der Ordner wird ja für ini erstellt, genau. :dancer2:
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Ja und was hat das damit zutun, ja die ini existiert nicht, aber danach wird ja wieder nach nem anderem Verzeichnis gefragt. :gruebel: Verstehe ich nicht.
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Hab wahrscheinlich nicht mitkopiert, aber das Programm läuft, also es fehlt nichts. Wie gesagt "Ja" wird ausgegeben, dann lösche ich den Ordner "AppDataProjectDir" und die Meldung "Nein" springt nicht auf.
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
procedure TForm1.FormShow(Sender: TObject);
var update: Integer;
Ini : TIniFile;
UserAppDataDir, ProgPath: String;
begin
UserAppDataDir := GetSpecialFolder(CSIDL_LOCAL_APPDATA);
if FileExists(UserAppDataDir + AppDataRootDir + AppDataProjectDir + '\Config.ini') then
begin
Ini := TIniFile.Create(UserAppDataDir + AppDataRootDir + AppDataProjectDir + '\Config.ini');
try
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Ne nix dazwischen, eins zu eins kopiert.
Das wird im Ereignis TForm1.FormShow aufgerufen, vllt liegt hier der Fehler? :gruebel:
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Ja das werde ich ändern, ist kein Problem, das Problem ist wieso die Fehlermeldung nicht kommt, wenn das Verzeichnis nicht existiert. :gruebel:
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Hab schon gefunden
Path := ExtractFilePath(ParamStr(0));
aber wieso funkt der Code im Post #5 nicht das verstehe ich nicht. :gruebel:
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Und in welchen Fällen kann das kein Programmverzeichnis sein?
Wie komme ich dann an das Programmverzeichnis? Gibt' dafür ein Befehl oder muss man ne Funktion schreiben?
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Wieso "rein zufällig"? :gruebel:
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Hab das jetzt so gelöst
if DirectoryExists(UserAppDataDir + AppDataRootDir + AppDataProjectDir) then
begin
showmessage('Ja');
end else showmessage('Nein');
wenn das Verzeichnis existiert wird "Ja" angezeigt, wenn nicht kommt die Meldung "Nein" gar nicht, wer weiß wieso?
-
Forum: Sonstige Fragen zu Delphi
Delphi
by AlexII,
22. Apr 2009
Hallo,
hab folgendes Problem: ich prüfe wie folgt auf Existenz einer Datei:
if FileExists(UserAppDataDir + AppDataRootDir + AppDataProjectDir + '\original.txt') then
begin
ListBox1.Items.LoadFromFile(UserAppDataDir + AppDataRootDir + AppDataProjectDir + '\original.txt');
end else ListBox1.Items.LoadFromFile('ersatz.txt'); (hier wird die Datei aus dem Programmverzeichnis geladen)