Autor Beitrag
110022
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Fr 11.01.08 13:38 
ich hab die form2.caption: C:\Dokumente und Einstellunten\.....\Hallo\Test.rtf
wie kann ich im Programm den pfad ohne das test.rtf öffnen?
also C:\Dokumente und Einstellunten\.....\Hallo
halt der ordner in dem die datei liegt.

mfg 110022
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Fr 11.01.08 13:43 
ExtractFilePath + F1

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Fr 11.01.08 14:07 
also extractfilepath( und dann?
DrRzf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 260

Win XP Prof
D7 Enterprise
BeitragVerfasst: Fr 11.01.08 14:12 
user profile icon110022 hat folgendes geschrieben:
also extractfilepath( und dann?


ausblenden Delphi-Quelltext
1:
C:\Dokumente und Einstellunten\.....\Hallo\Test.rtf);					

_________________
rein statistisch gesehen darf man keiner statistik trauen die man nicht selbst gefälscht hat.
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Fr 11.01.08 14:14 
ich würds so machen

ExtractFilePath(form2.Caption);

aber das klappt nich
DrRzf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 260

Win XP Prof
D7 Enterprise
BeitragVerfasst: Fr 11.01.08 14:18 
Was willst du überhaupt ? Irgendwie check ichs nicht.
du willst von einer Datei den pfad wissen.
den kannste so auslesen

ausblenden Delphi-Quelltext
1:
path := ExtractFilePath(C:\Programme\blabla\hmm\deinedatei.dat);					


danach findet sich in path 'C:\Programme\blabla\hmm\'
path muss natürlich eine var vom typ string sein.
zur naot mal ExtractFilePath in den editor eingeben, markieren und F1 drücken (Delphi Hilfe)


Edit:
hab grad gesehn du hast den dateinamen inkl pfad in der caption drinnen
ausblenden Delphi-Quelltext
1:
path := ExtractFilePath(Form1.Caption);					


falls der Pfad in der titelleiste gekürzt ist '\...\' dann musst du den dateinamen vorher abfangen.

_________________
rein statistisch gesehen darf man keiner statistik trauen die man nicht selbst gefälscht hat.
Kroko
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1284

W98 W2k WXP
Turbo D
BeitragVerfasst: Fr 11.01.08 14:28 
user profile iconKroko hat folgendes geschrieben:
ExtractFilePath + F1

ohne Worte!

_________________
Die F1-Taste steht nicht unter Naturschutz und darf somit regelmäßig und oft benutzt werden! oder Wer lesen kann, ist klar im Vorteil!
110022 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 287

XP SP2
Delphi 7
BeitragVerfasst: Fr 11.01.08 14:34 
klappt!!!! :D
danke