I have used the FileOpenDlg() function to allow the user to choose a file. I would like to do the same thing to allow them to choose a folder so I can save files to the folder without the user having to interact every time a file saves. Is there a function for this?


There is no MapBasic command to get a directory path. You can extract the directory from a full file path string and truncating at the last \ etc, but it's messy and not a nice solution.

A much better way is to use a Shell API or .NET function, some examples of which can be found here: https://groups.google.com/forum/#!msg/mapinfo-l/MGFhmQSpmwo/7irVqnPhZosJ

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.