SelectAll oddities with SaveDialog

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.

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

Let lvPath = ""
Let lvFileName = lvDataSet+" Data.txt"

savedialog lvPath,
    "Prompt","Save Company Data",

If lvPath = ""

zlog "X"
Filesave lvPath,lvData

And yes, I know that ArrayBuild does not require me to SelectAll.

I encountered no problems running it regardless of the first line, but it is a very small database. I ran it on a slightly larger database (900 rows and 120 fields) also with no problems.

Thanks for that, Tom. After more testing I determined that it was related to the active form. Going to the data sheet it worked properly.

The key form of the file has a couple of Text Lists. As it turned out, eliminating one that has an arraymultisort( made it work without those issues. Oddly, I used Undo to restore the TextList and it continued to work. :confounded: Alas, the hours I spent spinning my wheels on this trying to figure out what was wrong with the procedure. I hope it will stayed “fixed”.