Questions tagged [mapbasic]

MapBasic is a programming language for the creation of additional tools and functionality for MapInfo Pro Desktop GIS

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k 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 ...
user15642's user avatar
0 votes
1 answer
640 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 ...
user15642's user avatar
0 votes
1 answer
1k views

MapBasic. Where-clause in Select Statement

What is wrong with this statement? I reckon the where-clause is the problem. Select * from "BEDIRECT_POT_" + vo_num, PLZ5_2012_bereinigt where "BEDIRECT_POT_" + vo_num.PLZ like PLZ5_2012_bereinigt....
Agnes's user avatar
  • 1
0 votes
1 answer
2k views

Automatically updating table column with name of table using MapBasic

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 ...
Jon athan's user avatar
0 votes
1 answer
685 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 ...
Mr_Chimp's user avatar
  • 3,773
0 votes
1 answer
453 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 dialog?...
kinkajou's user avatar
  • 4,406
0 votes
2 answers
361 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 ...
Mr_Chimp's user avatar
  • 3,773
0 votes
1 answer
2k views

How to create a Button with custom Icons in Mapinfo 10?

I am using mapinfo 10 and I have created dll with Pelles C with 16*16 and 24*24 bmp images. I placed the dll file into folder containing .mbx file but I get error : Unableable to locate external ...
kinkajou's user avatar
  • 4,406
0 votes
1 answer
1k views

MapInfo - programmatically find if layer is hidden

I am working on an integrated mapping project. I would like a button that toggles a layer. I could hold the layers status in a variable and then show/hide it as appropriate but this seems a little ...
Mr_Chimp's user avatar
  • 3,773
0 votes
1 answer
554 views

Using data from table to make buttons in Mapbasic?

I have select Query that selects distinct value from a column. Is is possible to use these distinct values in my mapbasic program to make buttons and button labels? More Info: SQL Query : Select ...
kinkajou's user avatar
  • 4,406
0 votes
2 answers
855 views

How to find which table has layer in mapinfo?

Is it possible to find if table has layer Or print list of layers? Edit:: I have a table when I selete some data from table like: Select * from earth where population >100 Then it create new ...
kinkajou's user avatar
  • 4,406
0 votes
1 answer
79 views

What kind of table is bingHybrid?

I closed all table but I don't wan't to close underlying map eg like bingHybrid in mapinfo. How to prevent. Any detail about there map and way to handle while closing layers would be appreciated.
kinkajou's user avatar
  • 4,406
0 votes
1 answer
205 views

MapBasic, MapInfo Pro automation of existing Raster Operations

I have the latest version of MapInfo Pro and I would like to know if it is possible to fully automate the use of existing Raster operations into several files at once? For example, having several ...
William's user avatar
0 votes
1 answer
37 views

Does Mapbasic work with MapInfo Discover?

Does Mapbasic work with MapInfo Discover? From what I've been able to figure out it does not. I was really hoping to make some macro style things to help automate some of our process but it doesn't ...
Adam's user avatar
  • 1
0 votes
1 answer
98 views

Mapinfo - Compare Road Direction

I have two layers of Road Networks. How do I compare the difference in road direction between the two layers - both are polylines?
Pauline's user avatar
0 votes
1 answer
87 views

Write variable content into specific cell of datasheet (Mapbasic)

I have a value stored in a variable. How can I write this value to a table (for example into Row2 Column4) using Mapbasic?
sn1ks's user avatar
  • 3,002
0 votes
2 answers
240 views

Run mapbasic 32 bit mbx from larger mapbasic 64bit project

I need to run a 32-bit mbx within a 64-bit mbx -is this possible? Basically within a larger 64bit mbx routine, I need to call a mapbasic 32 bit mbx so that I can apply some regex code to a table. ...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
591 views

How to print table information using mapbasic

How do I print a tables information in Mapbasic? I have a snippet of code - I want to select all features within a buffer and then print the results as a message in mapinfo that can be copied out into ...
Jonathan West's user avatar
0 votes
1 answer
477 views

Converting .grd to .asc using MapBasic in MapInfo 16

Can someone please provide an example to show how this would work. For example, I am trying to convert from .GRD to .ASC, would my MapBasic code look like this: public void Convert(string "C:\Users\...
MapInfoNewbie's user avatar
0 votes
1 answer
606 views

Printing select query result in text file in mapbasic

I want to print a select query having number of records in text file in mapbasic but no successful results as i am using below code: Open file "E:\Export.txt" for output as #1 Print #1, select Col1, ...
user514348's user avatar
0 votes
1 answer
250 views

unrecognized Do loop error in mapbasic

unrecognized command do is occurring when i am trying to use below code in mapbasic window. can anyone help me how to fix it although syntaz is correct fetch first from t1 Do while Not EOT(t1) '...
user102435's user avatar
0 votes
1 answer
142 views

Error in SQL query in mapbasic

I am writing below SQL query in mapbasic to insert columns from two tables t1 and t2 into table Sites but error is occuring "Variable or field t2.CELLID not defined" Table Sites (Source integer, N ...
user102418's user avatar
0 votes
1 answer
858 views

Running a function in Mapbasic

I've been trying to invoke my first MB function to do some error handling and I keep getting an "Unrecognised command: OpenTab". We have Function OpenTab(ByVal TableName as String, ByVal sAlias as ...
GeorgeC's user avatar
  • 8,228
0 votes
1 answer
410 views

mapbasic update a column with centroid of object

I have a table that has a few polygons. I would like to extract the centroid of each polygon and fill up the columns named, Cent_X, and Cent_Y. The syntax for getting the centroid is CentroidX(obj) ...
marlin's user avatar
  • 1
0 votes
1 answer
100 views

Error while using methods in MapBasic

I am using a .dll file methods in mapbasic declare method openmultiplefilesdlg Class "mbextensions",lib "mbextensiondlgs.dll" (declaration variable) as string but it shows error: Found [...
Rajesh Deswal's user avatar
0 votes
2 answers
843 views

Why font size doesn't set for text in MapBasic?

I have annotations layer with that was imported from ArcGIS and want to set font in MapInfo. ArcGIS annotations contains its settings inside annotations objects (in Shape field, as I guess) but this ...
General Failure's user avatar
0 votes
1 answer
492 views

How to list tables in MS Access database using MapBasic?

My task is read data from *.mdb files using Mapbasic. Code to open MS Access database is seen in help immediately: Register Table source_file Type ACCESS Table table_name where source_file is ...
General Failure's user avatar
0 votes
1 answer
391 views

Sectors pointing to a lat long [closed]

Is it possible to find which sectors of a site are pointing to a specific lat long at a distance away?
Karl's user avatar
  • 69
0 votes
1 answer
167 views

Problem compiling a file in MapBasic v 10.5

There are 4 error messages with the script below. Can anybody find out how to solve them please? Everything seemed to match up in Notepad++. The error messages: [End sub] found without ...
Rob Curtis's user avatar
0 votes
1 answer
211 views

Creating points from variable without long/lat using MapBasic?

Can anyone help me to create a points without long/lat in mapbasic if i have a table with variable integer. I will have popupmenu for this table and everytime i select one it will create a points ...
Ivan's user avatar
  • 71
0 votes
1 answer
387 views

Compiling table from six source tables using MapBasic

I have a project which I am reviving after a gap of some years. It involves several hundred runs within MapInfo, scripted in MapBasic. At one point within each run, I have six tables, each of a single ...
Bruce Mitchell's user avatar
0 votes
1 answer
1k views

Transform coordinates in MapInfo with GSB data

Does anybody know if MapInfo (or MapBasic) is capable to do coordinate transformation using the NTv2 (National Transformation version 2) method? Currently Switzerland changes their national ...
Wernfried Domscheit's user avatar
0 votes
2 answers
602 views

MapBasic, create polygon, insert node

I'm trying to create a parcel table from coordinates. My MapBasic scripts are below. Why don't I get any results showing on the map? Create Table "parsel" (Parsel_Adi Char(10)) file "D:\data\parsel\...
user30773's user avatar
0 votes
1 answer
542 views

In mapbasic,how to register a table in xlsx,not in xls?

I have tow files that only differ in extention name, one xls ,the other xlsx.both contained the same things,same structure.there's no problem when I registered a table in xls,but when in xlsx,an ...
dinge's user avatar
  • 1
0 votes
1 answer
1k 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 manually....
user15642's user avatar
0 votes
2 answers
1k 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 ...
Alan Carr's user avatar
  • 2,475
0 votes
1 answer
713 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...
Agnes's user avatar
  • 1
0 votes
1 answer
829 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 ...
user15642's user avatar
0 votes
2 answers
1k 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 ...
Alan Carr's user avatar
  • 2,475
0 votes
1 answer
826 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 ...
Mr_Chimp's user avatar
  • 3,773
0 votes
1 answer
164 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 { ...
P Thomas's user avatar
0 votes
1 answer
516 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
kinkajou's user avatar
  • 4,406
0 votes
1 answer
418 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 ="...
kinkajou's user avatar
  • 4,406
0 votes
1 answer
973 views

How does MapInfo handle button identifiers?

As in create button pad statement: Create ButtonPad { title_string | ID pad_num } As button_definition [ button_definition ... ] [ Title title_string ] [ Width w ] [ Position ( x,...
kinkajou's user avatar
  • 4,406
0 votes
1 answer
2k views

How to dynamically connect Excel data sources to MapInfo?

How to connect Excel(2010) with Mapinfo(10.0)? I saw that Excel can be connected using Excel as Data Source but my Data Source is already MS-SQL. Actually I would like to reflect any changes in excel ...
kinkajou's user avatar
  • 4,406
0 votes
1 answer
1k views

Where does MapInfo store its error and log files?

I am having errors opening a table with spatial co-ordinates in Microsoft SQL and my question in gis.stackexchange is here. I want to know where are the error and log files of Mapinfo stored. I ...
kinkajou's user avatar
  • 4,406
0 votes
1 answer
622 views

How to upload lines created by joining longitude, latitude pairs?

The data in a Mapinfo table contain longitude and latitude pairs. I have joined the point pairs using : Making the table mappable Setting the projection to WGS84 and update TABLE set obj = ...
kinkajou's user avatar
  • 4,406
0 votes
0 answers
16 views

MapInfo Print StatusBar

Is there a way to directly print the information from the MapInfo Statusbar to like a .txt file or to be used as a string for either mapbasic or VB6?
OmniMapper's user avatar
0 votes
1 answer
23 views

Initiating object creation without ToolButton using MapBasic

Is it possible to have a subroutine in MapBasic that will initiate object creation, in same way as if you clicked Spatial->Insert->Polyline for example. I know I can create custom ToolButton and ...
Kevin Malone's user avatar
0 votes
0 answers
22 views

Querying User input

I have a small program that selects the table and columns, however I want to query specifically columns that matches the user input. Table_Name = TableInfo(iTabSelection, TAB_INFO_NAME) 'get the Table ...
ule's user avatar
  • 11