I am new to MapBasic.
I googled for tutorials and found various PDFs but could not get started with the resources.
I would be glad if anyone could provide some path for learning MapBasic.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Also if you are looking for a way to learn MapBasic more than a way to learn programming, there is a huge help in MapInfo Pro thru the MapBasic window.
Open the MapBasic window (Options > Show MapBasic Window) and do the task you want to code in MapBasic in MapInfo Pro. MapInfo Pro will now write the MapBasic statements required. You can now copy these into your MapBasic source code and work from this.
It's not all that can be done this way, but it gives you a very good insight into a lot of the MapBasic statements
There are also a number of web pages where you can find tools including MapBasic source code to get you on the right track.
Sometimes it might be helpful to have a look at the source code for an existing tool to see how it has been made.
Have a look at these sites:
Some of these site do hold some pretty old tools but many of these will still work.
You can also find some other discussion forums where you can find answers and ask your own:
As for actual writing MapBasic application I will only recommend the MapBasic Text Editor for small projects. As soon as you start creating more advanced projects I would recommend that you find a better text editor.
One option here would to use the MapBasic IDE developed by Mustafa ÖZÇETİN. On the blog you can find a very good guide to getting started with the MapBasic IDE.
I was lucky enough to learn MapBasic from some other colleagues.
I have not found many resources for MapBasic other than what Pitney Bowes offers on the site.
I spotted this tutorial that looks fairly good for new starters.
There is currently only a handful of MapBasic questions on this site, and only a few people following that tag, but if you have more specific questions, feel free to ask here and we will try and help out.
Not a tutorial but something I found very useful is this site: http://www.twiav.nl/php/mapbasic.php
I would highly recommend setting up Notepad++ (or something similar). Syntax highlighting, bulk indenting and bulk commenting can speed things up massively.
Sorry for digging out an old thread, but the MapBasic UserGuide and MapBasic Reference are probably the 2 best resources for getting started with MapBasic.
I myself started off simply observing code generation in the MapBasic Window (see what Peter suggested). Then I started making my own MapBasic Window scripts in Excel:
Then after a while I found out that MapBasic can be compiled into .MBX tools and these have the benefit of being able to use Loops, Flow control, dialogues etc.
So then I started writing .mb files and compiling them to .MBX. After a little while longer I started wanting to make MapBasic applications with Ribbon Buttons. You can do this with the Alter ButtonPad statement but it is better to use the RIBBONLib created by Peter. To do so you need to get started with .MBPs - I found this difficult but got their in the end.
As you can see from my own experience, I've learnt more as and when I wanted it and have always strove to develop my knowledge. This has involved lots of googling, lots of reading in the MapBasic reference/userguide, lots of talking to PBSupport and lots of reading from (and asking questions on) MapInfo-L google group.