Fejl i gode
Jeg har et problem med denne kode lige meget hvad jeg gør melder den fejl ...unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TForm2 = class(TForm)
RichEdit1: TRichEdit;
SaveDialog1: TSaveDialog;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.SaveDialog1CanClose(Sender: TObject); <--Her
var CanClose: Boolean);
begin
If MessageDlg('Gem fil?',MtConfirmation, [mbYes, mbNo], 0) = mrYes
Then
begin
If Form2.Caption='Unavngivet dokument' then
SaveDialog1.Filename:=''
Else
Savedialog1.filename:=Form2.caption
If Savedialog1.execute then
Richedit1.LineStart.Savetofile(SaveDialog1.Filename);
end;
end;
end.
<----------------- i denne linje -------------------->
procedure TForm2.SaveDialog1CanClose(Sender: TObject);
<---------------------------------------------------->