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

Win XP
Delphi 7
BeitragVerfasst: Di 03.10.06 18:58 
Hi erstmal,
ich hab da ma zwei Fragen:
1. Beim speichern soll an einem bestimmten Ort eine .txt datei erschaffen werden mit dem
Namen 'XY'

2. Ich kann zwar memos speichern aber nicht edit oder label felder

Wie geht det.
Vielen dank im vorraus
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 03.10.06 19:04 
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 03.10.06 19:05 
Erzeugen einer TextFile, XML oder IniFile.

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

Win XP
Delphi 7
BeitragVerfasst: Di 03.10.06 19:09 
eineer textfile (.txt)
Unknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Di 03.10.06 19:10 
@ Marc.
die links funzen bei mir net

sorry gehendoch, bringen mich aber nicht weiter
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 03.10.06 19:21 
Der zweite link sollte dich weiterbringen
Zu deiner ersten Frage: Benutz doch einfach die TSavedialog-Komponente ;)
Unknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Di 03.10.06 19:25 
Wie genau benutzt man diesen Tsavedialog???
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: Di 03.10.06 19:29 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
if savedialog1.execute then
begin
   //Hier erfolgt der Speichervorgang
   //auf den vom User gewählten Dateipfad greifst du mit Savedialog1.Filename zu!!
   showmessage('Dateipfad: '+savedialog1.filename);
end;

_________________
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: Di 03.10.06 19:41 
versteh ich net

ich will nur wenn man auf nen button clickt das in einem bestimmten Pfad eine .txt datei ersteht `XY`
und in dieser .txt datei soll der eingegebene text (z.b. in einem edit) gespeichert werden
DnC
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 98

XP
Delphi 3,6,7,2005 PE
BeitragVerfasst: Di 03.10.06 19:51 
is doch ganz einfach:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
{...}
var myStringList:TStringlist;
{...}
myStringList:=TStringlist.Create;
myStriglist.Add(Edit1.Text);
if SaveDialog1.Execute then
  myStringList.SaveToFile(SaveDialog1.Filename);//oder auch 'xy.txt'
myStringList.Free;
{...}


und... Die Suchefunktion sollte man schon kennen und benutzen können :roll:
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: Di 03.10.06 19:53 
user profile iconUnknown hat folgendes geschrieben:
versteh ich net

Du hast gefragt, wie man damit arbeitet! Was verstehst du denn daran nicht? :roll:
user profile iconUnknown hat folgendes geschrieben:
ich will nur wenn man auf nen button clickt das in einem bestimmten Pfad eine .txt datei ersteht `XY`
und in dieser .txt datei soll der eingegebene text (z.b. in einem edit) gespeichert werden

Lade den String in eine Stringlist und benutze die Methode SaveToFile. Um den Dateipfad wählen zu lassen, gibt es TSaveDialog. Nun stelle mal eine konkrete Frage!
Edit: Da hat dir jemand netterweise schon den ganzen Code gepostet.

_________________
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: Di 03.10.06 19:54 
ok das mit dem speichern habe ich verstanden aber das mit dem erstellen einer .txt datei noch net (bitte ausführlich bin anfänger)
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: Di 03.10.06 19:57 
user profile iconUnknown hat folgendes geschrieben:
ok das mit dem speichern habe ich verstanden aber das mit dem erstellen einer .txt datei noch net (bitte ausführlich bin anfänger)

Ist das nicht irgendwo das Gleiche? ;)

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

XP
Delphi 3,6,7,2005 PE
BeitragVerfasst: Di 03.10.06 19:57 
wenn du speicherst, wird eine Datei erstellt oder überschrieben. Wenn du als Dateiendung zufällig grade .txt hast, wird eben eine Textdatei erstellt
Unknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Di 03.10.06 20:01 
also wenn ich schreibe:
(Kein delphi Quelltext :( )
Memo1.lines.savetofile(C:/Blabla.txt)
dann wird in C: ein blabla.txt erstellt???
DnC
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 98

XP
Delphi 3,6,7,2005 PE
BeitragVerfasst: Di 03.10.06 20:02 
wenn noch keins da ist, ja
Unknown Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 184

Win XP
Delphi 7
BeitragVerfasst: Di 03.10.06 20:04 
da hab ich noch eine letzte frage
Das geht bei mir net:
edit1.text.savetofile(C:/Blabla.txt)
DnC
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 98

XP
Delphi 3,6,7,2005 PE
BeitragVerfasst: Di 03.10.06 20:06 
Weil Edit1.Text ein String ist und man Strings nicht abspeichern kann. Das kann man nur mit Sachen in der Art von TStringlist.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 03.10.06 20:07 
Memo <> Edit

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

Win XP
Delphi 7
BeitragVerfasst: Di 03.10.06 20:08 
also kann man edit sachen nicht abspeichern?? oda hab ich da was falsch verstanden