Autor Beitrag
crossit
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Sa 18.04.09 22:24 
hey leute also bin neu hier im forum und habe gleich mal ne frage warum zeigt er mir immer das die funktion einen ergebnistypen benötigt ( bei function Ttextfilename.gethasbeensaved : boolean;)
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
unit ufilename;

interface
TYPE
TTextfilename= class(TObject)
    private
  FFilename: string;   afilename : string;
  Fisdirty: boolean;    gethasbeensaved : boolean;
   procedure    setfilename(const Value: string);
   procedure    setisdirty(const value: boolean);
   procedure    Initialize;
  function    getfilename: string;
    public
   constructor create;
   constructor createwithfilename(aFilename: string);
   function shouldsave : boolean;
     published
  property hasbeensaved : boolean read gethasbeensaved;
  property Filename : string read FFilename write setfilename;
  property isdirty : boolean read Fisdirty write setisdirty;
end;
implementation
   uses dialogs,controls;
constructor TTextfilename.createwithfilename(afilename : string);
begin
   inherited create;
   initialize;
 end;
constructor TTextfilename.create;
begin
   inherited create;
   initialize;
   Ffilename := aFilename;
end;



function  Ttextfilename.getfilename: string;
begin

  if ffilename = '' then
  begin
    result:= 'unbenannte Datei';

end else
begin
  result := ffilename;
end;


function Ttextfilename.gethasbeensaved: Boolean;
begin
     result:= ffilename <> '';
end;


procedure TTextfilename.Initialize;
begin
   Isdirty := true;
   ffilename := '';
 end;

procedure TTextfilename.setfilename(const value : string);
 begin
    ffilename :=value;
 end;
 procedure TTextfilename.setisdirty(const value : boolean);
 begin
    Fisdirty:=value;
 end;



function ttextfilename.shouldsave : boolean;
 var
temppromp : string;
tempanswer : integer;
begin
   result:= false;
   if isdirty then
   begin
     temppromp := 'Den Scheiß"'+filename +'"haste geändert. willste saven?';
     tempanswer:= messagedlg(temppromp, mtconfirmation, [mbYes, mbNo, mbCancel], 0);
      if tempanswer = mrno then
        begin
               isdirty := false;
        end;
        Result:= tempanswer = mryes;
   end;





end;


end.



Moderiert von user profile iconChristian S.: Topic aus Sonstiges (Delphi) verschoben am Sa 18.04.2009 um 23:54


Zuletzt bearbeitet von crossit am So 19.04.09 01:50, insgesamt 2-mal bearbeitet
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: Sa 18.04.09 22:29 
Ich formatiere mal einen Teil deines Sources, dann erledigt sich die Frage von allein:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
function TTextFileName.getFilename: String;
begin
  if fFileName = '' then
  begin
    Result := 'unbenannte Datei';
  end
  else
  begin
    Result := fFileName;
  end;

function TTextFileName.getHasBeenSaved: Boolean;
begin
  Result := fFileName <> '';
end;


Na, fällt dir auf was fehlt?

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



BeitragVerfasst: Sa 18.04.09 22:57 
hmmm so auf die schnelll nicht-.-
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Sa 18.04.09 23:02 
Ich löse auf:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
function TTextFileName.getFilename: String;
begin
  if fFileName = '' then
  begin
    Result := 'unbenannte Datei';
  end
  else
  begin
    Result := fFileName;
  end;
end;
function TTextFileName.getHasBeenSaved: Boolean;
begin
  Result := fFileName <> '';
end;

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
crossit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Sa 18.04.09 23:23 
ahhh stimmt gleich geändert danke!habe jedoch festgestellt, dasss
es trozdem angezeigt das bei dem wert function ttextfilename.gethasbeensaved: boolean; die deklination falsch ist welches ja mein hauptproblem war
SvenAbeln
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 334
Erhaltene Danke: 3



BeitragVerfasst: So 19.04.09 00:00 
Deine Klasse besitzt gar keine Funktion gethasbeensaved.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
TTextfilename= class(TObject)
  private
    FFilename: string;   
    afilename : string;
    Fisdirty: boolean;    
    function gethasbeensaved : boolean;  // hier fehlte ein function
    procedure    setfilename(const Value: string);
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 19.04.09 00:03 

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: So 19.04.09 01:25 
user profile iconcrossit hat folgendes geschrieben Zum zitierten Posting springen:
ahhh stimmt gleich geändert danke!habe jedoch festgestellt, dasss
es trozdem angezeigt das bei dem wert function ttextfilename.gethasbeensaved: boolean; die deklination falsch ist welches ja mein hauptproblem war

Das Ding heißt übrigens Deklaration.. abschreiben sollte man schon können :P

Edit: OK, ich hätte mir die Links von Christian ansehen sollen, sry.

_________________
PROGRAMMER: A device for converting coffee into software.
crossit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: So 19.04.09 01:50 
Zitat:

Das Ding heißt übrigens Deklaration.. abschreiben sollte man schon können :P

Edit: OK, ich hätte mir die Links von Christian ansehen sollen, sry.

keiner ist perfekt :wink: aber stimmt hast recht
nun noch meine letzte frage: wieso wird der dateiname den hier von '' nicht auf 'unbenannteDatei' geändert?? stimmt was in dem code nicht?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
function  Ttextfilename.getfilename: string;
begin

  if ffilename = '' then
  begin
    result:= 'unbenannteDatei';

end else
begin
  result := ffilename;
end;
end;

function Ttextfilename.getHasbeensaved: boolean;
begin
     result:= ffilename <> '';
end;

procedure TTextfilename.Initialize;
begin
   Isdirty := true;
   ffilename := '';
 end;

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
function ttextfilename.shouldsave : boolean;
 var
temppromp : string;
tempanswer : integer;
begin
   result:= false;
   if isdirty then
   begin
     temppromp := 'Den Scheiß"'+ ffilename +'"haste geändert. willste saven?';
     tempanswer:= messagedlg(temppromp, mtconfirmation, [mbYes, mbNo, mbCancel], 0);
      if tempanswer = mrno then
        begin
               isdirty := false;
        end;
        Result:= tempanswer = mryes;
   end;
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 19.04.09 02:29 
Wofür deklarierst du aFileName nochmal? Das sollte doch eigentlich der Parameter des Konstruktors sein. Aber fällt dir etwas auf?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
constructor TTextfilename.createwithfilename(afilename : string);
begin
   inherited create;
   initialize;
 end;

constructor TTextfilename.create;
begin
   inherited create;
   initialize;
   Ffilename := aFilename;
end;
In dem ersten Konstruktor übergibst du den Parameter, im zweiten verwendest du ihn... :shock:

Zum Problem: Setz doch einfach einen Haltepunkt auf die if-Abfrage und schau was passiert.
crossit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: So 19.04.09 03:08 
also hatte einen haltepunkt gesetzt jedoch hat sich nichts verändert
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 19.04.09 03:09 
Naja, aber dort müsste das Programm dann ja ankommen, und dann kannst du schauen was passiert, wenn du schrittweise weiterlaufen lässt.
crossit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Mo 20.04.09 16:07 
also hatte das mit dem haltepunkten die letzten 35 mins gemacht und den fehler nicht gefunden-.-
kann mir keiner nen anderen tip geben?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 20.04.09 16:58 
Dann zeig doch mal den soweit korrigierten Quelltext inkl. Verwendung, also dem Code, mit dem du das aufrufst.
crossit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 39



BeitragVerfasst: Mo 20.04.09 17:20 
ok also als erstes die mainform
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
unit frmmainform;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Menus, StdCtrls, ActnList, StdActns,ufilename, ImgList, ComCtrls,
  ToolWin;

type
  TMainform = class(TForm)
    MainMenu1: TMainMenu;
    bermich1: TMenuItem;
    aboutme1: TMenuItem;
    Datei1: TMenuItem;
    Exit1: TMenuItem;
    ActionList1: TActionList;
    Memo1: TMemo;
    FileOpen1: TFileOpen;
    N1: TMenuItem;
    ffnen1: TMenuItem;
    FileSaveAs1: TFileSaveAs;
    Speichernals1: TMenuItem;
    Speichern1: TMenuItem;
    saveaction: TAction;
    newAction1: TAction;
    neu1: TMenuItem;
    Bearbeitung1: TMenuItem;
    EditCut1: TEditCut;
    EditCopy1: TEditCopy;
    EditPaste1: TEditPaste;
    EditSelectAll1: TEditSelectAll;
    EditUndo1: TEditUndo;
    EditDelete1: TEditDelete;
    Ausschneiden1: TMenuItem;
    Kopieren1: TMenuItem;
    Lschen1: TMenuItem;
    Rckgngig1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    Allesmarkieren1: TMenuItem;
    SearchFind1: TSearchFind;
    SearchFindNext1: TSearchFindNext;
    SearchReplace1: TSearchReplace;
    SearchFindFirst1: TSearchFindFirst;
    Suchen1: TMenuItem;
    Weitersuchen1: TMenuItem;
    N4: TMenuItem;
    Ersetzen1: TMenuItem;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ToolButton4: TToolButton;
    ToolButton5: TToolButton;
    ImageList1: TImageList;
    ToolButton6: TToolButton;
    ToolButton7: TToolButton;
    ToolButton8: TToolButton;
    ToolButton9: TToolButton;
    ToolButton10: TToolButton;
    ToolButton11: TToolButton;
    ToolButton12: TToolButton;
    ToolButton13: TToolButton;
    ToolButton14: TToolButton;
    Fo1: TMenuItem;
    Zeichenumbruch: TMenuItem;
    WordWrapAction: TAction;
    FontEdit1: TFontEdit;
    Schriftartwhlen1: TMenuItem;
    Action1: TAction;
    einfgenDatumtime1: TMenuItem;
    procedure Exit1Click(Sender: TObject);
    procedure aboutme1Click(Sender: TObject);
    procedure FileOpen1Accept(Sender: TObject);
    procedure Formcreate(Sender: TObject);

    procedure Formdestroy(Sender: TObject);
    procedure Filesaveas1accept(Sender: TObject);
    procedure newaction1execute(Sender: TObject);
    procedure saveactionexecute(Sender: TObject);
    procedure Memo1Change(Sender: TObject);
    procedure WordWrapActionExecute(Sender: TObject);
    procedure FontEdit1Accept(Sender: TObject);
    procedure Action1Execute(Sender: TObject);
  private
    { Private-Deklarationen }
     ffilename : TTextfilename;
    function savethefile: boolean;
   public
    { Public-Deklarationen }
  end;
var
  Mainform: TMainform;
implementation

{$R *.dfm}
uses frmabout;

procedure TMainform.aboutme1Click(Sender: TObject);
begin
   aboutbox.ShowModal;
end;


procedure TMainform.Action1Execute(Sender: TObject);
begin
 memo1.SelText := datetimetostr (Now);
end;

procedure TMainform.Exit1Click(Sender: TObject);
begin
          if ffilename.shouldsave then
    begin
     if savethefile then ;
     memo1.Clear;
     ffilename.Clear;
    end else
    begin
     close;
    end;
end;

procedure TMainform.FileOpen1Accept(Sender: TObject);

begin
 ffilename.Filename:=fileopen1.dialog.filename;
  if fileExists(ffilename.Filename) then
  begin
    memo1.lines.LoadFromFile(ffilename.Filename)
  end;
    Ffilename.isdirty:= false;
 end;
procedure TMainform.Filesaveas1accept(Sender: TObject);
begin
ffilename.Filename := filesaveas1.Dialog.filename;
ffilename.isdirty := false;
memo1.Lines.SaveToFile(ffilename.filename);
end;
procedure TMainform.FontEdit1Accept(Sender: TObject);
begin
    memo1.Font  := fontedit1.dialog.Font;
end;

procedure TMainform.Formcreate(Sender: TObject);
begin
Ffilename:= TTextfilename.create;
end;

procedure TMainform.Formdestroy(Sender: TObject);
begin
ffilename.Free;
end;


procedure TMainform.Memo1Change(Sender: TObject);
begin
    ffilename.isdirty := true;
end;

procedure TMainform.newaction1execute(Sender: TObject);
begin
      if ffilename.shouldsave then
    begin
     if savethefile then ;
     memo1.Clear;
     ffilename.Clear;
    end else
    begin
     memo1.Clear;
     ffilename.Clear;
    end;
 end;
procedure TMainform.saveactionexecute(Sender: TObject);
begin
     memo1.Lines.SaveToFile(ffilename.Filename);
end;

function tmainform.savethefile: boolean;
var
tempfilename : string;

begin
  result := false;
 if ffilename.hasbeensaved then
 begin
  memo1.Lines.SaveToFile(ffilename.filename);
  ffilename.isdirty := false;
  result := true;
 end else
 begin
    filesaveas1.execute ;
    tempfilename := filesaveas1.Dialog.FileName;
    if  tempfilename <> ''  then
    begin
  ffilename.Filename := tempfilename;
  memo1.Lines.SaveToFile(ffilename.Filename);
  result:= true;
 end;
end;
end;
procedure TMainform.WordWrapActionExecute(Sender: TObject);
begin
    memo1.WordWrap := not memo1.WordWrap;
    wordwrapaction.Checked  := memo1.WordWrap;
    if memo1.WordWrap then
    begin
      memo1.ScrollBars :=   ssVertical;
    end else
    begin
      memo1.ScrollBars :=ssboth;
    end;
end;

end.


und hier dann die ufilename wo die sachen bestimmt sind
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
unit ufilename;

interface
TYPE
TTextfilename= class(TObject)
    private
  FFilename: string;   afilename : string;
  Fisdirty: boolean;
   procedure    setfilename(const Value: string);
   procedure    setisdirty(const value: boolean);
   procedure    Initialize;
  function    getfilename: string;
  function    gethasbeensaved : boolean;
    public
   constructor create;
   procedure clear;
   constructor createwithfilename(aFilename: string);
   function shouldsave : boolean;
     published
  property hasbeensaved : boolean read gethasbeensaved;
  property Filename : string read FFilename write setfilename;
  property isdirty : boolean read Fisdirty write setisdirty;
end;
implementation
   uses dialogs,controls;
constructor TTextfilename.createwithfilename(afilename : string);
begin
   inherited create;
   initialize;
 end;
constructor TTextfilename.create;
begin
   inherited create;
   initialize;
   Ffilename := aFilename;
end;
procedure ttextfilename.clear;
begin
  Initialize;
end;


function  Ttextfilename.getfilename: string;
begin

  if ffilename = '' then
  begin
    result:= 'unbenannteDatei';

end else
begin
  result := ffilename;
end;
end;

function Ttextfilename.getHasbeensaved: boolean;
begin
     result:= ffilename <> '';
end;

procedure TTextfilename.Initialize;
begin
   Isdirty := true;
   ffilename := '';
 end;

procedure TTextfilename.setfilename(const value : string);
 begin
    ffilename :=value;
 end;
 procedure TTextfilename.setisdirty(const value : boolean);
 begin
    Fisdirty:=value;
 end;



function ttextfilename.shouldsave : boolean;
 var
temppromp : string;
tempanswer : integer;
begin
   result:= false;
   if isdirty then
   begin
     temppromp := 'Den Scheiß"'+ filename +'"haste geändert. willste saven?';
     tempanswer:= messagedlg(temppromp, mtconfirmation, [mbYes, mbNo, mbCancel], 0);
      if tempanswer = mrno then
        begin
               isdirty := false;
        end;
        Result:= tempanswer = mryes;
   end;





end;


end.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 20.04.09 17:28 
Du hast den von mir angesprochenen Fehler mit den Konstruktoren z.B. nicht behoben... :roll:
user profile iconjaenicke hat folgendes geschrieben Zum zitierten Posting springen:
Wofür deklarierst du aFileName nochmal? Das sollte doch eigentlich der Parameter des Konstruktors sein. Aber fällt dir etwas auf?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
constructor TTextfilename.createwithfilename(afilename : string);
begin
   inherited create;
   initialize;
 end;

constructor TTextfilename.create;
begin
   inherited create;
   initialize;
   Ffilename := aFilename;
end;
In dem ersten Konstruktor übergibst du den Parameter, im zweiten verwendest du ihn... :shock:
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Mo 20.04.09 18:51 
user profile iconcrossit hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
function ttextfilename.shouldsave : boolean;
 var
temppromp : string;
tempanswer : integer;
begin
   result:= false;
   if isdirty then
   begin
     temppromp := 'Den Scheiß"'ffilename +'"haste geändert. willste saven?';
     tempanswer:= messagedlg(temppromp, mtconfirmation, [mbYes, mbNo, mbCancel], 0);
      if tempanswer = mrno then
        begin
               isdirty := false;
        end;
        Result:= tempanswer = mryes;
   end;

Du greifst ja auf das Feld zu - das ist ja auch leer. Die Kontrolle erfolgt ja erst in der Funktion getfilename:

user profile iconcrossit hat folgendes geschrieben Zum zitierten Posting springen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
function  Ttextfilename.getfilename: string;
begin

  if ffilename = '' then
  begin
    result:= 'unbenannteDatei';

end else
begin
  result := ffilename;
end;
end;


:arrow: verwende die Funktion anstatt des Feldes :idea: