You can use FileSaveAsDlg() to let the user specify a not-existing file.
This will also warn the user about overwriting a potential existing file.
Are you looking to le the user just pick the output directory?
This is useful if you create multiple outputs
Peter
From: mapi...@googlegroups.com <mapi...@googlegroups.com>
On Behalf Of Richard Robinson
Sent: 23. oktober 2024 12:46
To: MapInfo-L <mapi...@googlegroups.com>
Subject: [MI-L] Output folder selection
This message originated Externally. Use proper judgement and caution with attachments, links, or responses. |
I wish to be able to select a folder for the output of a mbx to save results but am having difficulty in finding the appropriate MapBasic code. The nearest I have found is the FileOpenDlg("","","*.*","Output Location") command but this requires the selection of a existing file within the output directory!
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mapinfo-l+...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mapinfo-l/9330321a-2f47-4869-a8cf-94f351467e30n%40googlegroups.com.
Hi
Try this:
You can find the DLL here in the MapBasic Common Library:
https://github.com/PeterHorsbollMoller/mbLibrary
The file FILELib.dll.def contains a listing of all the methods in the DLL:
https://github.com/PeterHorsbollMoller/mbLibrary/blob/master/FILELib.dll.def
Declare Method FILEBrowseForFolder
Class "FILELib.Files" Lib "FILELib.dll" Alias "BrowseForFolder"
( ByVal sDescription As String 'Text to display in the dialog
, ByVal sFolder As String 'Start folder to use in the dialog
) As String
Or download the file FILELib.DLL.def from above to get access to more methods from the DLL and include this in your source code at the top:
Include "FILELib.DLL.def"
sPath = FILEBrowseForFolder("Select directory for output data...", sPath)
If sPath = "" Then
Exit Sub
End If
Cheers
Hi Richard
I created this article going over some of the options for selecting files and folder:
https://community.precisely.com/discussion/mapbasic-monday-selecting-files-and-folders
Cheers
Peter
From: 'Peter Horsbøll Møller' via MapInfo-L <mapi...@googlegroups.com>
Sent: 24. oktober 2024 11:38
To: mapi...@googlegroups.com
Subject: RE: [MI-L] Output folder selection
This message originated Externally. Use proper judgement and caution with attachments, links, or responses. |
--
--
You received this message because you are subscribed to the
Google Groups "MapInfo-L" group.To post a message to this group, send
email to mapi...@googlegroups.com
To unsubscribe from this group, go to:
http://groups.google.com/group/mapinfo-l/subscribe?hl=en
For more options, information and links to MapInfo resources (searching
archives, feature requests, to visit our Wiki, visit the Welcome page at
http://groups.google.com/group/mapinfo-l?hl=en
---
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
mapinfo-l+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mapinfo-l/BY1PR16MB6381D5369286AF252D00ABA0964E2%40BY1PR16MB6381.namprd16.prod.outlook.com.