【发布时间】:2021-06-30 17:56:10
【问题描述】:
我想将数据窗口信息导出到 .txt 文件。当我单击导出按钮时,将打开另存为对话框。如果存在同名的 .txt 文档,则会弹出 MessageBox 询问我是否要替换该文件。如果我按否,则另存为对话框正在关闭。如何防止另存为对话框关闭?我想返回它并为文件命名。
这是我的代码:
li_rc = GetFileSaveName (lcs_title, ls_path_filename, ls_filename, 'txt', 'TXT File (*.txt), *.txt' )
if li_rc > 0 then
if FileExists (ls_path_filename) then
//Existing file has been found
if MessageBox (lcs_title, 'Replace the file '+ ls_path_filename +'?', Question!, YesNo!, 1) = 2 then
//Do not replace the file
//Return to dialog?
else
//Replace the file
dw_1.SaveAs(ls_path_filename, Text!, false)
end if
end if
end if
谢谢!
【问题讨论】:
标签: dialog powerbuilder save-as datawindow