Autor Beitrag
Melcho
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 145

XP

BeitragVerfasst: Mi 30.03.05 09:19 
Moin Jungs muss ma was fragen und zwar hab ich ein paar Saves zu tätigen und lege dafür ne Save.txt an aber wie bekomm ich es hin das er die Save.txt immer im Programmverzeichnid anlegt ?

Danke euch !

_________________
PCP saved my life
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 30.03.05 09:23 
Benutze folgende Funktion:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
Function GetAppPath : String;
var
  Pfad : String;
begin
  Pfad := ExtractFilePath(ParamStr(0));
  if Pfad[Length(Pfad)] <> '\' then Pfad := Pfad + '\';
  Result := Pfad;
end;

Und schreibe das Ergebnis vor deinen gewünschten Dateinamen.
Melcho Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 145

XP

BeitragVerfasst: Mi 30.03.05 09:30 
ohhh Danke alta so schnell und so richtig DANKE DANKE :flehan:

_________________
PCP saved my life
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 30.03.05 10:27 
Wieso denn in drei Zeilen?

ausblenden Delphi-Quelltext
1:
Pfad := ExtractFilePath(ParamStr(0)) + 'meinOrdner';					


Das reicht auch und ob du da noch ein \ oder nicht machst, ist egal.


31>17: 'Get' muss weg.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)


Zuletzt bearbeitet von GTA-Place am Mi 30.03.05 10:49, insgesamt 1-mal bearbeitet
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 30.03.05 10:42 
GetExtractFilePath kenn ich nicht. Habe aber auch nur D5Pro.
Bei ExtractFilePath ist die Prüfung auf "\" erforderlich! Wenn das Anwendungsverzeichnis das Hauptverzeichnis ist, wird nämlich kein "\" geliefert!
Man sollte dort zwar keine Applikationen haben, aber sicher ist sicher.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 30.03.05 10:48 
Ah ne, ich mein auch "ExtractFilePath" und bei D7 kommt '\' immer.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)