Autor Beitrag
Florian.K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

Win Xp Prof. & SP 2
Delphi 10 Lite
BeitragVerfasst: Mo 07.05.07 16:49 
Hi Community!
Ich habe folgendes problem.

Ich habe folgende speicherprozedur
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.speichern(Sender: TObject);
var
  fs: TFileStream;
  Filename, SaveString: string ;
begin
  edit1.text:=Savestring;
  fs := TFileStream.Create (Filename, fmCreate);
  try
    if SaveString <> '' then
      fs.Write (SaveString[1], Length (SaveString));
  finally
    fs.Free;


als message bekomm ich diesen Error

First chance exception at $7C812A5B. Exception class EFCreateError with message 'Cannot create file "". Das System kann den angegebenen Pfad nicht finden'. Process Arbeitsplan_P.exe (1372)

Meine Frage ist
Warum ?
Müsste er die .txt nicht im .exe Ordner speichern ?

mfg
florian
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: Mo 07.05.07 17:06 
Zitat:
Hinweis: Savestring könnte undefiniert sein.
Hinweis: Filename könnte undefiniert sein.

So oder so ähnlich meckert der Compiler, weil 1. weist du dem Edit was zu, statts dem String und 2. hast du dem Compiler nie gesagt, was Filename für ein Pfad ist, deshalb ist der Pfad = ''.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 07.05.07 17:58 
Es nützt eben nichts wenn man nur kopiert und nicht weiss was man da macht.
Ich hab Dir in deinem anderen Thread
www.delphi-forum.de/...72538&highlight=
zwei Links gepostet, die solltest Du Dir vieleicht mal anschauen.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Florian.K Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 130

Win Xp Prof. & SP 2
Delphi 10 Lite
BeitragVerfasst: Di 08.05.07 17:36 
Ich habe den Rest meines Programmes alles selber geschrieben und nun soll ich an der saveprozedur scheitern?
hm ne
Mit crashkursen muss ich mich länger beschäftigen. Ich bin nur Hobbyprogrammierer der sich alle 10 wochen mal hinsetzt und ein kleines Programm schreibt.
Das ist das Problem