In the following procedure, if the first line is enabled, the procedure blows through to the end with no pauses. The GetText and SaveDialog are stacked and the zlog’s “X” is logged. Run it again and it only gets to the GetText. The next run tends to go back to the first result and so on.
If I disable the GetText section, it runs a little closer to what’s expected but gets an error that lvPath does not exist at the end.
With that first line disabled it runs as desired. Including or excluding SelectAll makes all the difference.
;SelectAll
RemoveAllSummaries
Let lvData = ""
ArrayBuild lvData,cr(),"",exportline()
Let lvDataSet = "CompanyName"
gettext "Name of Data Set?",lvDataSet
If lvDataSet = "" Stop EndIf
Let lvSavePath = dbfolder()+"DataSources/"+lvDataSet+"/"
If pathexists(lvSavePath) = 0
MakeFolder lvSavePath
EndIf
Let lvPath = ""
Let lvFileName = lvDataSet+" Data.txt"
savedialog lvPath,
"InitialPath",lvSavePath,
"FileName",lvFileName,
"FileTypes",".txt",
"Prompt","Save Company Data",
"CanCreateFolders",true()
If lvPath = ""
Rtn
EndIf
zlog "X"
Filesave lvPath,lvData
And yes, I know that ArrayBuild does not require me to SelectAll.