在使用opendialog的时候提示了找不到系统的指定路径,请问如何解决啊!
具体的源代码procedure setfilename(const filename:string);
//设置文件名
var ffilename : string;
begin
ffilename := filename;
mainform.Caption := format('%s-%s',[extractfilename(filename),application.Title]);
end;
procedure checkfilesave;
//显示一个提醒存盘的消息框,并根据用户的反馈执行相应的动作
var
saver:integer;
begin
if not mainform.RichEdit1.Modified then
exit;
saver := messagedlg(format('将修改的文件存入文件%s?',[ffilename]),mtconfirmation,mbyesnocancel,0);
case saver of
idyes : mainform.RichEdit1.Lines.SaveToFile(ffilename);
idno: ;
idcancel : abort;
end;
end;
procedure TMainform.N7Click(Sender: TObject);
//文件的打开功能;
begin
checkfilesave;
if opendialog1.Execute then
begin
performfileopen(opendialog1.FileName);
mainform.RichEdit1.ReadOnly := ofreadonly in opendialog1.Options;
end;
end;
请问我该如何改进呢?
谢谢了,
具体的源代码procedure setfilename(const filename:string);
//设置文件名
var ffilename : string;
begin
ffilename := filename;
mainform.Caption := format('%s-%s',[extractfilename(filename),application.Title]);
end;
procedure checkfilesave;
//显示一个提醒存盘的消息框,并根据用户的反馈执行相应的动作
var
saver:integer;
begin
if not mainform.RichEdit1.Modified then
exit;
saver := messagedlg(format('将修改的文件存入文件%s?',[ffilename]),mtconfirmation,mbyesnocancel,0);
case saver of
idyes : mainform.RichEdit1.Lines.SaveToFile(ffilename);
idno: ;
idcancel : abort;
end;
end;
procedure TMainform.N7Click(Sender: TObject);
//文件的打开功能;
begin
checkfilesave;
if opendialog1.Execute then
begin
performfileopen(opendialog1.FileName);
mainform.RichEdit1.ReadOnly := ofreadonly in opendialog1.Options;
end;
end;
请问我该如何改进呢?
谢谢了,
自己看Help,什么都有的http://lysoft.7u7.net
这里面可能有问题。
估计是这里处理opendialog传进去的参数有问题。