MapBasic is a programming language for creation of additional tools and functionality for the MapInfo geographical information system.

learn more… | top users | synonyms

0
votes
3answers
385 views

How to set code for designer legend in mapbasic

last couple of days i am doing work on thematic maps using mapbasic. I am getting error while set the legend code. it giving me unrecognized command or code kind of error ... my code is Create ...
0
votes
0answers
195 views

How to set Window id in Mapbasic?

Last couple of days i am working with creating thematic map using MapBasic. I am facing some difficulties while doing scripting and compilation.i am getting error due to Dynamic Window Id. does any ...
0
votes
1answer
262 views

How to write code for page setup in Mapbasic

I am very new to mapbasic scripting. i am creating thematic map using mapbaic code. For that i am searching code for Page setup to set my map as landscape with A4 size. But i didn't found any code for ...
1
vote
1answer
161 views

Handler tool in MapBasic

Have any handler or procedure, that call automatic when the click or unclick menu item or button? Similiar SelChangedHandler.
1
vote
0answers
44 views

Check Text Mode when Typing text MapInfo

I'm writing a code MapBasic How do I know text mode when I add text to Map. Can help me!, check cursor texting mode
0
votes
1answer
191 views

Pack table option in MapBasic

I write a code pack all table in Map Window, after pack all table, some tables are removed from map window, How do I known which table is pack, and open table to map window in the order as original ...
1
vote
1answer
96 views

How to make a shortest path code in mapbasic?

I have a column table that consist of 2 points (from / to), i wanted to have a dialog box that will show all possible path from source to destination from a list box and show the shortest path with ...
1
vote
1answer
81 views

How can I make a dialog box floating while working on the window?

I would like to have a floating dialog box just like the Named Views.mbx How could make my existing dialog box float while working on other window? Thanks!
1
vote
1answer
219 views

How to select all unique values in a column and put it in multilist box?

I wanted to collect all unique values in a column and show it in multilist box.
1
vote
1answer
199 views

What arguments does MapBasic's ColumnInfo() take?

MapBasic's tableInfo() function has a KnowledgeBase docs page here listing the arguments and all the attributes it takes, and a usage example in the reference document. columnInfo() has neither of ...
1
vote
1answer
961 views

How to loop through all columns in a table/layer getting all data for a row/feature in MapBasic?

I'm trying to extend this GNU-licensed plugin MI2SVG, which converts MapInfo maps to SVG, so that it writes associated table data into the SVG it creates, so that browser based JS web applications can ...
2
votes
0answers
75 views

String Size/Query in Mapbasic

I want to select many objects on the screen and select other objects that share the same attributes with the chosen group. So I'm creating a tool to select many object based in five tables' columns ...
4
votes
2answers
401 views

How do I snip/split polylines at chainages?

What is the best way to snip/split lines at chainages? E.g I have a csv with the uniq ID of the polyline item and a start and end chainage. I want to extract the lines between the chainages stated. ...
0
votes
1answer
358 views

How do I automatically print individual regions from a MapInfo table to a PDF without interactively selecting and printing each one?

I need to automatically print individual polygons that make up a table. I need them to be a close-up view of the polygon and print to a PDF file. It is very time consuming to print each one ...
1
vote
1answer
202 views

Mapinfo SQL Query for compare for edited data in tables

I have a table that contain several columns, each has their own data. then, someone have made some change in the data (just a little one data editing). how do i know later what data have been ...
0
votes
1answer
514 views

How to work with tables in MapBasic?

I try to get data from table use MapBasic: Dim nCol = "ColumnName" Fetch First From Untitled Do While Not EOT(Untitled) colValue = Selection.nCol Note colValue Fetch Next From Untitled Loop ...
0
votes
2answers
237 views

Updating a column with line direction in MapInfo

I was wondering if there is a way to update a column in MapInfo with the digitised line direction. I have two TAB files, one is complete lines and the other is sections of the same lines (both have a ...
0
votes
1answer
275 views

In MapBasic, how do I allow a user to choose a folder?

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 ...
0
votes
1answer
175 views

MapBasic | Objects Combine

Can anybody tell me how I can combine the geo objects of one relation to one single object? I reckon the Object Combine function is right one, but I have no idea how to specify the code... Thanks, ...
0
votes
1answer
263 views

In MapBasic, how do I register a table in XLS format that has a different range from one execution to another?

I need my application to be able to register an XLS table that does not have a set range. One time it may be A2:AL10000, the next it may be A2:AL2000, etc. I have not seen this anywhere in the ...
0
votes
1answer
338 views

Map Basic. Where-clause in Select Statement

what is wrong with this statement? I recon the where-clause is the problem. Select * from "BEDIRECT_POT_" + vo_num, PLZ5_2012_bereinigt where "BEDIRECT_POT_" + vo_num.PLZ like ...
1
vote
1answer
63 views

In MapBasic, how do I open a connection to MapMarker so I can allow my app to geocode?

I would like my app to open up MapMarker and automatically geocode for me. I cannot get past the Open Connection statement as I am receiving an error while compiling. Here is the code: Include ...
1
vote
1answer
701 views

In MapBasic, how do you place a user selected string from a FileOpenDlg() statement into an EditText field for use by a sub procedure?

I have created a custom menu that displays a dialog box when clicked on. I have made the "Browse" button to call a FileOpenDlg() statement. I want the file that the user selects to populate in the ...
1
vote
1answer
599 views

In MapBasic, how do I display a dialog box as the result of a menu item being clicked on?

I have created a menu item in MapBasic. I need to call a procedure to open a dialog box as the result of one of the menu items being selected. I believe I am having trouble declaring the sub ...
1
vote
2answers
344 views

Selecting an item with the mouse in MapBasic

This may seem relatively simple, but I'm pretty confused. I have written a mapbasic tool that does things to the table 'Selection' depending on user choices in a popup menu, but currently you need to ...
1
vote
1answer
274 views

Deleting duplicates from multiple tables

Using the delete duplicates tool is there a way in Mapbasic to have it run through a large number of tables, or do you have to manually select each table and run the tool? Cheers, Jon
1
vote
1answer
416 views

Automatically updating a table column with the name of table

Does anyone know a straightforward way in MapBasic to automatically update a table column with the name of the table the column exists in? Going from the MapBasic reference guide it seems the ...
0
votes
1answer
335 views

How do I build a custom menu to change preferences for a MapBasic application?

I would like to be able to input a few different tables for an application. I want to be able to set the path before the app runs. How do I create a preference box and what code do I use to call the ...
1
vote
1answer
304 views

Question about the TableInfo function in MapBasic

I have a problem I really can't seem to get my head around, MapInfo crashes when I try to run and if statement. I have pretty much exactly the same code in another sub to check for other things and ...
3
votes
2answers
274 views

How to write an equivalent to MapBasic's CreateLine in pyQGIS?

I know this kind of question has been asked, in part, before - specifically: Seeing QGIS Python Commands and: How is object created as line using createline stored in .tab file? but this is a specific ...
0
votes
1answer
73 views

Question about subs in MapBasic

For some reason my sub isn't 'linking' in MapBasic, I'm pretty new to this, but why is the sub assuming it begins on line 110 rather than where it actually says sub? Thanks, Alan
0
votes
0answers
233 views

Help exporting CSVs using MapBasic

I'm a beginner to MapBasic and I'm currently working on a tool, I want to export a table as a .csv either using Run Command or Export. I want to export it to a specific directory, for example ...
1
vote
2answers
369 views

Setting custom valid values to a MapInfo field?

I was wondering if it was possible in MapInfo to set valid values for a field, e.g a field called material and only valid values being BIT, CON or STO? I have a basic knowledge of MapBasic. Thanks, ...
2
votes
2answers
11k views

Converting .kml file to .tab (Map info) format

If I have saved polygons as a (.kml) Google Earth File and I want to draw it in MapInfo, is there a tool to do this ? If not, how can be it be made using MapBasic?
1
vote
1answer
54 views

Request to run mapbasic 10.5 code in mapbasic 9.1 version

I have created mapbasic codes using 10.5 version. Now I have to run in a lower version (9.1) Please anyone help me how to do this.. How to copy paste the program codes from 10.5 version to 9.1 ...
0
votes
2answers
517 views

Labeling from a defined string in MapBasic

I am currently working on a code to apply a variety of different changes to layers with certain attributes, I have been successful with this so far (thanks to Peter). However I now want to add a text ...
0
votes
1answer
372 views

Modifying tables based on title (MapInfo)

I have a query regarding the Mapbasic feature of MapInfo, I want to change the line style of an item depending on name (e.g if the .tab name contains the world group). I think I can work this out with ...
0
votes
1answer
199 views

What is the best way to sum the area from a number of polygons in .NET/SQL Server?

I have an Mapbasic/.NET application that read data from SQL Server 2008 R2. I have a table with polygons and need to sum up the area of a subset of the polygons. This should work dynamic so the user ...
1
vote
1answer
543 views

MapBasic Create Circle Round a Point

I've been tasked with creating a simple MapBasic plug-in that will loop through a table in MapInfo, zoom to the location of each point, create a circle to highlight the point, and convert the map to ...
2
votes
1answer
765 views

How to change the view of a map window in MapInfo to a new center coordinate?

How can I change the map view of a map window in MapInfo Professional to a new center coordinate? I need to change the viewed map in the MapInfo window via a predefined set of coordinates via ...
2
votes
3answers
1k views

Fully automating a workspace to create maps with different file names but same information?

I have a lot of maps (over 600) to create. They all contain the same column titles and the layouts will be the same. I don't want to have to go through and repeat the same process everytime, I would ...
3
votes
1answer
299 views

MultiListBox array error

I have created a MultiListBox control which is populated with a list of all currently loaded TAB file names in MapInfo. The user selections are then read from the MultiListBox and added to another ...
2
votes
1answer
4k views

Creating polygons from points in Mapinfo

I have a huge number of points(co-ordinates), from which I am required to draw a polygon in Mapinfo. This required polygon is a square of 200m size. All I have now is the left side lower end of the ...
0
votes
1answer
367 views

Get name/number of the table currently being edited

In MapInfo you can edit one table at a time. How can I programmatically get the name or ID number of the table that is currently being edited? I tried the following function: Function ...
3
votes
2answers
610 views

Create collection from selected objects

I have a table with a series of objects in it. Each record has a reference number but these numbers are NOT unique - e.g. there are two records with reference "01" and each of them has a different ...
0
votes
1answer
2k views

Compare two tables. Show values only in one table

I have two tables. Each table has a column with a reference number. Most of the records in these tables are the same but there are some which are in one table but not in the other. How can I compare ...
2
votes
1answer
641 views

Getting number of tables loaded with integrated mapping

I am integrating a MapInfo map into a form in an Access database. I am trying to find out the number of tables loaded but NumTables() and MapperInfo() are both getting "unrecognized command" errors. ...
1
vote
1answer
903 views

Escaping spaces in paths for use in batch file

I am making a MapInfo program in MapBasic. I am calling OGR2OGR in order to convert some files. To do this I am generating a batch file and then running it. My code looks something like this: RunStr ...
0
votes
1answer
579 views

Find if a table is mappable/contains an Obj column

How do I check whether a table is mappable? I am trying to select all records from a table that contain objects, like this: Select * From TableName Where Obj Into TempTable If a table doesn't have ...
0
votes
2answers
1k views

Select only records with region objects in MapBasic

I am writing a program that finds overlapping objects. I can't perform the AreaOverlap() function on objects that don't enclose an area (e.g. text, points) as the result would be meaningless. Is ...