TWIAV - Tips & tricks

TWIAV - Tips & tricks

MapBasic Code Samples


On this page you will find some MapBasic code samples, both the program source and the compiled application. Everything on this page is offered "as is" without warranty of any kind, either expressed or implied, including limitation warranties of merchantability, fitness for a particular purpose, and noninfringement.


Unless otherwise stated MapBasic 9.0 has been used to compile the files - this means that the MBXs offered here will only run with MapInfo Professional 9.0 or higher. If you want to use the tools with another (an older) version of MapInfo Professional, you will have to compile the tool using the relevant version of the Mapbasic compiler.


The MapBasic Code Samples Project


The goal of this project is to provide some examples of how to use certain MapBasic functionality - not to offer full-blown applications. The applications below each focus on one 'trick'. You can study the source, modify it to suit your needs and implement it in your own apps.


The following code samples are available here:





Context Menu Sample Code


This application demonstrates how to add a new menu item to a context menu.

To see how it works:

  • Right-click on a table in the Table List to view a pop-up menu with the new menu item: Save Table As...


(If you select 'Save Table As...' you can save the table with a new name and location. After saving the new table, the original table will be closed and the new table will be opened.)




Please see the file below for ContextMenu.MB and ContextMenu.MBX.
 ContextMenu.zip
Table List Context Menu

The Table List is new in MapInfo Professional 10.5






More code samples will follow...;-)



What do you think of these code samples? If you have any , please let me know.