MapInfo Pro Developers User Group

Welcome to the MapInfo Pro Developers community!  We are a group dedicated to the discussion and understanding of MapBasic and .Net MapInfoPro AddIn development. Bring your questions and ideas here. This group includes several members of the Pro development team from around the world.

Please feel free to start a discussion in the discussion tab or join in a conversation.

Product Information  Ideas Portal  MapInfo Community Downloads

Discussions

Members

Resources

Events

 View Only
  • 1.  Getting files from a folder using MapBasic

    Posted 02-09-2018 13:17

    How can I open all the tables one by one from a directory using Map Basic. There is a way where I can list all the path's in one text file and read it on run-time for opening the tables but is there any better ways to do that ?



  • 2.  RE: Getting files from a folder using MapBasic

    Employee
    Posted 04-12-2018 03:07

    You can find a number of MapBasic libraries/modules that can give you a list of files in a directory. Use one of these to get the list and then loop thru the list and do your task with the individual tables.

    On Community Download you can find these libraries that can help you:

     

    The last one can be used like this:

    nNumFiles = FILEFindFilesInFolder("C:\Temp", "*.tab")

    For i = 1 To nNumFiles

    sFile = FILEGetFindFilesFileName(i)

    '**Do your work with the table

    Next

    Remember to copy the FILELib.dll to your application directory