-
Topic
-
following is a code snip that is not working as I need. When the user starts this app, they get a directory select dialog box, but if the press cancel, it does not cancel, it chooses c: as the default path and runs the rest of the program. It seems that “if iDlg.execute then” always evals to true even if you press cancel. How can I fix this so that if you press cancel, getExportDir remains = “”. IS this a bug, or a issue with my specific code or install on nt 4.0?
Please help
dim iStatusDlg
set iStatusDlg = Utilities.NewStatusDialog
iStatusDlg.ProgressRange = iMessages.count
iStatusDlg.CanCancel = TRUE
iStatusDlg.show
iStatusDlg.title = “Exporting Messages”
iStatusDlg.MainText = “Preparing to export…”if iStatusDlg.Cancel then
set iMessages = nothing
exit sub
end ifexportPath = Utilities.AddBackSlashToPath(getExportDir)
if exportPath = “” then
set iMessages = nothing
set iStatusDlg = nothing
exit sub
end if.. more code follows, and fucntions as well..
Function getExportDir()
getExportDir = “”
dim iDlg
set iDlg = Utilities.NewSelectDirectoryDialog
iDlg.Caption = “Select export directory”
if iDlg.execute then
getExportDir = iDlg.Directory
end if
set iDlg = nothing
End Function
- You must be logged in to reply to this topic.