关于{$IOCHECKS ON}的问题,高手帮帮忙,谢谢!!

MAX-长老 2006-10-23 11:15:05
我做了一个应用,是时间程序来的,当我启动程序后,要打开另外的一个窗口(选项),设置一些参数,然后确定回到主窗口,启动主程序应用,这个是主程序是根据一定的时间查找文件和解析文件,及从数据库中查找符合一定的条件的数据,然后生成文件。而选项里的设置是,将一些参数写入到INI文件中和新建目录,如下:
{$I-}

MkDir(lePathLocal.Text + '\bw');
MkDir(lePathLocal.Text + '\hz');
MkDir(lePathLocal.Text + '\log');

MkDir(lePathLocal.Text + '\convene');
MkDir(lePathLocal.Text + '\convene\bwzip');
MkDir(lePathLocal.Text + '\convene\hzzip');
MkDir(lePathLocal.Text + '\convene\temp');
MkDir(lePathLocal.Text + '\convene\bw');
MkDir(lePathLocal.Text + '\convene\hz');
MkDir(lePathLocal.Text + '\convene\backup');
MkDir(lePathLocal.Text + '\convene\backup\bw');
MkDir(lePathLocal.Text + '\convene\backup\hz');
MkDir(lePathLocal.Text + '\convene\backup\log');
MkDir(lePathLocal.Text + '\convene\backup\basecode');
MkDir(lePathLocal.Text + '\convene\basecode');
MkDir(lePathLocal.Text + '\convene\ErrorFile');

//最大行数
WriteINI('SYSTEM','MAXLINE',leMaxLine.Text);

//保存日志选项
WriteINI('SYSTEM','SaveLogOption',intToStr(combobox1.ItemIndex));

//运行始末时间
WriteINI('PARM','TIME_BEGIN',timeToStr(TPicker_Parm1.Time));
WriteINI('PARM','TIME_END',timeToStr(TPicker_Parm2.Time));
可是每次从数据库取出数据,然后形成文件的时候总是报错,错误提示如下:
---------------------------
Debugger Exception Notification
---------------------------
Project FExchange.exe raised exception class EInOutError with message 'I/O error 183'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
我是这样建立文件的:
try
AssignFile(F, fn);
Rewrite(F);
except
CloseFile(F);
Continue;
end;
要是,不打开选项的窗口,则不会出现这样的错误提示

大家帮忙看看有什么问题???
...全文
125 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
MAX-长老 2006-10-24
  • 打赏
  • 举报
回复
我试一试
dragonth 2006-10-24
  • 打赏
  • 举报
回复
可以用判断来做
DirectoryExists,这个函数应该可以满足你的要求。
比如:
try
if not DirectoryExists(lePathLocal.Text + '\convene\backup\bw') then
MkDir(lePathLocal.Text + '\convene\backup\bw');
except
end;
先判断,然后在看是否新建目录,最好加上TRY...EXCEPT
GHOSTSEA 2006-10-23
  • 打赏
  • 举报
回复
看起来满高深的,关注~~~

2,507

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧