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.  What to do when a field name in a Table in MapInfo Pro gives an error.

    Employee
    Posted 07-31-2017 06:33

    This pertains to when you are creating a table...



  • 2.  RE: What to do when a field name in a Table in MapInfo Pro gives an error.

    Employee
    Posted 07-31-2017 03:09

    This is a very useful tip for someone working with MapBasic.  There are certain words reserved which cannot be used as a field name. Do not use a MapBasic keyword as a variable name which applies to Table and Column names as well. 

    Restrictions on reserved words do not just apply to MapInfo Pro. If uploading a table to a DBMS such as Oracle, PostGIS, or SQL Server, or converting to another third-party format like SHP, these systems have their own lists of reserved words which may not be used as table or column names.

    Restrictions on Variable Names : Variable names are case-insensitive. A variable name may not begin with a number. Many MapBasic language keywords, such as Open, Close, Set, and Do, are reserved words which may not be used as variable names. An attempt to define a variable called Set, MapBasic will generate an error when compiling the program. 

    The table below summarizes the MapBasic keywords which may not be used as variable names.

    Add Alter Browse

    Call Close Commit

    Create DDE DDEExecute

    DDEPoke DDETerminate DDETerminateAll

    Declare Delete Dialog

    Dim Do Drop

    Else ElseIf End

    Error Event Exit

    Export Fetch Find For

    Function Get Global

    Goto Graph If

    Import Insert Layout

    Map Menu Note

    Objects OnError Open 

    Pack Print PrintWin 

    ProgressBar Proportion Put 

    ReDim Register Reload 

    Remove Rename Resume 

    Rollback Run Save 

    Seek Select Set 

    Shade StatusBar Stop 

    Sub Type Update 

    While



  • 3.  RE: What to do when a field name in a Table in MapInfo Pro gives an error.

    Employee
    Posted 07-31-2017 03:10

    Also, through MapBasic, we can declare every variable’s type explicitly, through the Dim statement, not like any other language where a $ denotes a variable. It is very well described in details in the MapBasic reference guide.



  • 4.  RE: What to do when a field name in a Table in MapInfo Pro gives an error.

    Employee
    Posted 07-31-2017 11:40

    Here is a comprehensive article that may also help with Reserved words being used in MapInfo Pro.

    Article: https://li360.pitneybowes.com/s/article/ka1800000004X45AAE/Oracle-and-reserved-words