Autor Beitrag
Palmm130
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Mo 11.02.08 22:05 
Hallo,

ich möchte für mein Programm eine Funktion haben,
womit ich ihren eigenen Speicherort
samt ihren Namen ausfindig machen kann...

das ganze kann gerne in eine String-Variable gespeichert werden,
sagen wir mal
Pfad:string;

habe Delphi 7 Pro

hat wer 'ne Idee, wie ich das realisieren kann ?


Zuletzt bearbeitet von Palmm130 am Mo 11.02.08 22:11, insgesamt 1-mal bearbeitet
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mo 11.02.08 22:08 
Das Stichwort lautet ParamStr(0). Bei Unklarheiten sollte es genügend Infos entweder in der DOH oder im Web zum Parameterstring geben.
Ist nur der Pfad gewünscht, so lässt sich der Name der Datei mit ExtractFilePath() entfernen.

cu
marc
Palmm130 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 26



BeitragVerfasst: Mo 11.02.08 22:10 
hilf mir, es selbst zu tun XD

aua, ist das leicht, danke sehr ^^

*closed*
dummzeuch
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 593
Erhaltene Danke: 5


Delphi 5 ent, Delphi 6 bis Delphi XE8 pro
BeitragVerfasst: Mi 13.02.08 19:31 
user profile iconMarc. hat folgendes geschrieben:
Das Stichwort lautet ParamStr(0).

oder Application.Exename

twm
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mi 13.02.08 19:41 
Was intern nichts anderes macht, als ParamStr(0) aufzurufen. Folglich ist ParamStr(0) ein ganz klein wenig (so wenig, dass man es nie merken wird) schneller.
Und es verbraucht weniger Speicher auf dem Stack, weil eine Rücksprungadresse weniger gespeichert werden muss.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.