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
1answer
424 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?...
0
votes
2answers
347 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
1k 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 ...
0
votes
1answer
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 ...
0
votes
1answer
514 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 ...
0
votes
2answers
575 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 ...
0
votes
1answer
76 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.
0
votes
1answer
21 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?
0
votes
1answer
102 views

Custom tool for Mapinfo

I'm new to Mapinfo and Mapbasic as well. I need to build a tool like in ArcMap (pythonaddins). The goal is to have a gui application which has three dropdown lists. First is a list of layers in ...
0
votes
2answers
48 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. ...
0
votes
1answer
202 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 ...
0
votes
1answer
324 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, ...
0
votes
1answer
108 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) '...
0
votes
1answer
87 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 ...
0
votes
1answer
735 views

Changing format of column from character to decimal or float in Mapinfo

We have some Mapbasic software that updates character fields in existing mapinfo tables to decimal or float. The character fields are mostly numeric but some values are N/A to indicate not applicable ...
0
votes
1answer
509 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 ...
0
votes
1answer
182 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) ...
0
votes
1answer
76 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 [...
0
votes
2answers
545 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 ...
0
votes
1answer
403 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 ...
0
votes
1answer
250 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?
0
votes
1answer
806 views

Edit listbox and table value from a dialog box

Good day! I have a code that import my table on a listbox and able to add on it. i was stock on some codes when i double click a selected value on my listbox to open another dialogbox to edit (the ...
0
votes
1answer
169 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 ...
0
votes
1answer
455 views

The command to open multiple tables in MapBasic

I would like to know what commands/statement can open (or select) multiple tables in MapBasic?. Please show me?
0
votes
2answers
474 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\...
0
votes
1answer
940 views

How to write to Sql server from MapBasic and insert rows

I have created a table in Sql server 2014 with the columns: Id (int), Geom (geometry), RouteId (int), Desc (varchar(MAX)) I have succeeded in making the table mappable through MapInfo I have checked ....
0
votes
2answers
141 views

How to Unit test MapBasic Programs?

Is there unit test frameworks available for MapBasic? I've been searching, but have not found anything.
0
votes
1answer
451 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 ...
0
votes
1answer
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....
0
votes
1answer
567 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...
0
votes
1answer
701 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 ...
0
votes
2answers
936 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
718 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 ...
0
votes
1answer
157 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 { ...
0
votes
1answer
472 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
0
votes
1answer
401 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 ="...
0
votes
1answer
894 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,...
0
votes
1answer
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 ...
0
votes
1answer
841 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 ...
0
votes
1answer
599 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 = ...
0
votes
0answers
25 views

Mapbasic crashes when simple print to text file is added

I want to log the message text in a mapbasic script to a txt file but the program now crashes. Print ProcessThese.FullPath Open file "D:\4_RefreshMB.txt" for output as #1 Print #1, ProcessThese....
0
votes
0answers
20 views

Unable to divide by zero mapinfo [duplicate]

I've to calculate a percentage in this query in mapbasic: Select * from Presence where Date="2016-10-09" into H1 noselect order by Municipalities Select * from Presence where Date="2016-10-16" into ...
0
votes
0answers
109 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\...
0
votes
0answers
66 views

Mapbasic code runs but no output is generated

My code (from previous questions here) to generate a list runs but there is no output... Include "MapBasic.def" Declare Sub Main Sub Main Dim path_to_temp_tables As String path_to_temp_tables = "" ...
0
votes
1answer
32 views

MapBasic freezes everytime i use “.”

I'm using Map Basic IDE Version 1.6.0.0. Every time I use the "." key the IDE always freezes. This freeze happens anytime I use this key, whether it be for comments, or to access a variable's fields. ...
0
votes
1answer
635 views

Expression does not evaluate to a column or table name error when updating object in MapBasic

I tries to set styles for all objects in my processing_table, but gets Expression does not evaluate to a column or table name My code: '... pen_style = currentpen() 'get_pen(styles_table_name, ...
0
votes
0answers
75 views

PRACH data plotted in a better way but not completely

I am close to finishing the visualization of PRACH in MapInfo. Here's my output so far (for 4 counters) Unfortunately, for some sectors it is not working as it should be. Can you please help out? ...
0
votes
1answer
352 views

error message: “Cannot split, erase or overlay with points, collection, Text or layout frame objects” in Mapbasic

In order to automate procedures using MapBasic, I wrote the code for overlapping two objects -- one a polygon object and the other a point object -- using Objects Intersect statement written below. ...
0
votes
0answers
635 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
713 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 ...