Autor Beitrag
Unknown
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Mi 04.10.06 20:53 
Diese Frage ist ein bissel kompliziert!

Ich wollte von euch wissen wie das geht:
Egal wohin das fertige Projekt hin getan wird (z.B Arbeitsplatz oder irgend ein bestimmter ordner),will ich schaffen, das die Textdatei die von diesem Projekt gespeichert wird (mit Hilfe von nem Memo)genau im gleichem Ordner wie das Projekt gespeichert wird!!
Wie dat geht :?: :?: :?: :?: :?: :?:
Bete für schnelle hilfe
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 20:55 
ausblenden Delphi-Quelltext
1:
ExtractFilePath( Application.ExeName)					

_________________
Markus Kinzler.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.10.06 20:55 
ausblenden Delphi-Quelltext
1:
Memo1.Lines.SaveToFile(ExtractFilePath(ParamStr(0))+'unknown.unknown');					

:mrgreen:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.10.06 20:56 
user profile iconmkinzler hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
ExtractFilePath( Application.ExeName)					

Warum bist du immer schneller? :lol:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 21:01 
user profile iconMarco D. hat folgendes geschrieben:
user profile iconmkinzler hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
ExtractFilePath( Application.ExeName)					

Warum bist du immer schneller? :lol:


Keine Ahnung :roll:

_________________
Markus Kinzler.
Unknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Mi 04.10.06 21:02 
user profile iconMarco D. hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
Memo1.Lines.SaveToFile(ExtractFilePath(ParamStr(0))+'unknown.unknown');					

:mrgreen:


könntest du mir das noch mal erklären?was die einzelnen befehle bedeuten

[edit1]also nur das Extracttofile und das Paramstr(0) erklären


[edit2] muss man dann beim laden das einfach mit loadfromfile eingeben oder irgendwie anders


Zuletzt bearbeitet von Unknown am Mi 04.10.06 21:07, insgesamt 1-mal bearbeitet
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 21:05 
-ParamStr(0) bzw. Application.ExeName enthält den Dateinamen der Exe inklusive Pfad. Z.B. c:\test\meine.exe
-ExtractFilePath enfernt den Namen der exe z.B. c:\test\
-Dann wird unknown.unknown hinzugefügt c:\test\unknown.unknown
-Am Schluß wird der Inhalt des Memos in diese Datei gespeichert.

_________________
Markus Kinzler.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mi 04.10.06 21:06 
user profile iconUnknown hat folgendes geschrieben:
user profile iconMarco D. hat folgendes geschrieben:
ausblenden Delphi-Quelltext
1:
Memo1.Lines.SaveToFile(ExtractFilePath(ParamStr(0))+'unknown.unknown');					

:mrgreen:


könntest du mir das noch mal erklären?was die einzelnen befehle bedeuten

Also gut:
Memo1.lines.SaveToFile --> klar, oder? :D
ExtractFilePath --> ist eine Funktion, die aus einem Dateipfad den Dateinamen löscht
ParamStr(0) --> ParamStr kann man gebrauchen, wenn man die Parameter auslesen will, die man an dein Programm übergeben hat, aber das ist für dich erstmal noch nebensächlich, merke dir einfach, dass damit den Dateipfad der Exe rausbekommt. Alternativ kannst du auch mkinzler's Vorschlag nehmen, aber das mit ExtractFilePath(ParamStr(0) habe ich seit dem Ini-Tutorial von www.dsdt.info eben so drinne. :mrgreen:

Edit: Ich geb's auf, schon wieder schneller :motz:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Unknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Mi 04.10.06 21:09 
und wie läd man das dann wieder

P.s.:ihr seid meine dsdt.info Website (schleim)
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 21:11 
Zitat:
und wie läd man das dann wieder

ausblenden Delphi-Quelltext
1:
Memo1.Lines.LoadFromFile(ExtractFilePath(ParamStr(0))+'unknown.unknown');					


BTW. Delphi besitzt auch ne Hilfefunktion und Autovervollständigung von Klassen. ;-)

_________________
Markus Kinzler.
Unknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Mi 04.10.06 21:15 
Vielen Dank !!!
Heute werde ich euch nicht mehr mit fragen bombadieren!!!
das war heute meine dritte oder?????? :shock: :shock:
na dann, bis morgen :P :P :P :P :P :P :P :twisted: :twisted: :twisted: :twisted:
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 21:18 
Zitat:
Heute werde ich euch nicht mehr mit fragen bombadieren!!!
Wir helfen gern ;-)

_________________
Markus Kinzler.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mi 04.10.06 21:23 
Warum auch nicht bei solchen Fragen !? :lol:
Aber die Obligatorische Weiterleitung auf die Suche im DF oder deiner Hauseigenen Delphi Hilfe würde auch nichts schaden. :wink:
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 04.10.06 21:27 
user profile iconBlackheart666 hat folgendes geschrieben:
Warum auch nicht bei solchen Fragen !? :lol:

Bei schwereren Fragen lassen wir dann dich vor :lol:
Zitat:
Aber die Obligatorische Weiterleitung auf die Suche im DF oder deiner Hauseigenen Delphi Hilfe würde auch nichts schaden. :wink:

www.delphi-forum.de/....php?p=391838#391838
[Edit: Quotes gefixt]

_________________
Markus Kinzler.


Zuletzt bearbeitet von mkinzler am Mi 04.10.06 21:46, insgesamt 1-mal bearbeitet
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mi 04.10.06 21:39 
Witzbold, So was lieb Ich ! :D