MapBasic is a programming language for creation of additional tools and functionality for the MapInfo geographical information system.
1
vote
1answer
31 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
31 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
63 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
32 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
90 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
27 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
48 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
56 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
761 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
0answers
29 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
93 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
155 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
80 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
0answers
205 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
191 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
442 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 ...
2
votes
1answer
126 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
2k 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
131 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
270 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
611 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
316 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
554 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
221 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
553 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 ...
1
vote
2answers
269 views
How to convert the SQL result to an array?
I want to design a popupmenu
And I use SQL to find the title I need
but I need to convert the table to an array in order to use Title From Variable xxx
3
votes
1answer
369 views
How can I change object image in MapInfo using MapBasic?
I need to change the image of the objects which are in the Selection Table using MapBasic functions. When I say "Image" I mean point object icon on the map.
3
votes
2answers
280 views
Mouse unclick event in mapbasic?
How can I respond to mouse unclick in mapinfo using mapbasic? Is there any event triggered when the mouse in unclicked? For example at the end of drawing a line when the mouse button is released.
1
vote
1answer
270 views
Find spatially identical records in Mapinfo
Is there a tool/mbx similar to the Arc INFO "Find Identical" to find records which have exactly the same shape?
1
vote
1answer
680 views
How to create a circular sector in Mapinfo?
I want to build a tool that creates a cell sector from data like that below. The sector diagram should be like the second picture. The first picture shows a Mapinfo tab file with the required fields ...
0
votes
1answer
89 views
Declarations required for Mapbasic api calls
I am trying to read a serial port by using api calls createfile, readfile, getcommstate, setcommstate etc...
this all requires the proper declaration of a structure "dcb"
typedef struct _DCB {
...
1
vote
1answer
124 views
Which version of mapbasic to use for maximum interoperability with different mapinfo versions?
The oldest mapbasic download offered by pbinsight these days seems to be version 9.5. I wonder can all subsequent versions of mapinfo run compiled code written with this?
If so, is an older (and ...
0
votes
1answer
158 views
Closing Visual Basic Dialog From Mapbasic?
How to close visual basic application from mapinfo using mapbasic?
The visual basic application was ran using - Run Program
1
vote
3answers
660 views
Different in distance measurements in MapBasic/MapInfo
I am trying to make a custom ToolButton but I am having some problems getting correct measurements.
I have drawn a line (using the normal line tool) and set its length to 1000m. (Double-clicking it ...
0
votes
1answer
225 views
Dialog statement
I am trying to write a code which has dialog including such as toggle button, edittext, pushbutton, popupmenu, etc. I have no problem with all, but when the dialog screen which is named "Find Name" ...
0
votes
1answer
154 views
How to update a Mapinfo layer at certain time intervalls?
I have point which represents stress signal. The signal changes at certain time. How do I implement this in mapinfo ? I did this using time() function and increment it to certain seconds but whole ...
2
votes
2answers
853 views
Drawing a circle of a given area in MapInfo
I would like to draw a circle in MapInfo exactly 0.9Ha in area.
I've done it by working out the corresponding radius should be, drawing a circle of arbitrary size, double clicking on it and then ...
0
votes
1answer
233 views
Get EditText value with event handler in MapBasic
I have a dialog in MapBasic that includes an EditText control, a PopupMenu control and a button. When the user presses the button a sub is called. In this sub I would like to get the values of the ...
0
votes
1answer
114 views
How to add close action to buttonpad and dialog?
I am making mapinfo addon and I am having problem with close action of buttonpads. How to add close action to dialog and buttonpad so that we can execute certain action on close of buttonpad or ...
3
votes
1answer
386 views
Check if an object is empty in mapbasic
I have mapbasic code that manipulates the obj-column in a point-table. Some rows doesn't have any geometry so the obj-column is empty. My question is how to check if there is no object?
All the ...
0
votes
2answers
121 views
Persistent settings in MapInfo programs
I have a couple of MapInfo programs that use external EXEs for some functionality (e.g. ogr2ogr for layer conversion and OV2 Tools for satnav data output).
In my programs I would like to have a ...
0
votes
1answer
88 views
Mapinfo 10 with new look does not show toggle state of button
Is this only a problem to me or a problem to other's too. I have mapbasic application that runs good on mapinfo 11 and mapinfo 10 with old look but this toggle button does not work with mapinfo 10 ...
2
votes
3answers
305 views
Is it possible to retrieve thematic layer information for a Layer in Mapbasic?
I found this code
windowinfo(FrontWindow(), WIN_INFO_CLONEWINDOW)
This function gives information (mapbasic) about the front Map window which can be used to regenerate the map.
Is there any ...
0
votes
1answer
199 views
How to reuse Thematic layer definitions in Mapinfo?
I have a map from table. Let the table be TABLE1. Now That I have created Thematic Map from Column1 of this table. Again I executed the following query
Select * from TABLE1 where TABLE1.column1 ...
1
vote
1answer
141 views
What is the sequence of select query execution in Mapinfo?
I have confusion with the following query:
Query 1:
Select * from TABLE where vendor = "vendor1" OR
"vendor2" OR
"vendor3" ...
0
votes
1answer
643 views
How to run query in mapbasic?
I made a Query in Mapbasic like :
Dim query As String
query = "Select * from some_table"
How to run query to form table? Is it possible to save selected value in variable without forming table?
2
votes
1answer
75 views
Does mapbasic support function overloading?
I am creating application with mapbasic. Now that it's been some time with mapbasic I found that the language is very fundamental and does not support functionality that I took for granted in Java or ...
0
votes
1answer
75 views
Is it possible to find if a value is present in Array without looping in mapbasic?
How to find a value is present in array without looping ?
e.g.
For i=1 TO ubount(Array)
Find if value is present
Next
or some more direct statement like
Array.contains(somevalue) like in java
...
1
vote
2answers
321 views
How to add element to Mapbasic Array?
Code:
Dim name_array() As String
Redim name_array(10)
How to add value to the array? I know we can add value by specifying index like name_array(i) = "some_value"
But I don't want to specify ...
1
vote
1answer
103 views
Is toggle button's state stored in some property in Mapinfo?
Well can we retrieve On or OFF state of toggle button. Do we have any property of toggle button that can be read from toggle button that is ON or OFF?
