Learning mapbasic

108 views
Skip to first unread message

Charles Lindenbaum

unread,
Mar 30, 2007, 9:37:02 AM3/30/07
to mapi...@googlegroups.com
Hi,

Could anyone advise me the best way to start learning mapbasic? I have
been using mapinfo for a number of years now but feel I need to progress
my skills further. What would be the best (and free) way to do this?

cheers

Charlie

Bill Thoen

unread,
Mar 30, 2007, 10:27:12 AM3/30/07
to mapi...@googlegroups.com
I'd recommend starting your journey by perusing the MapBasic Users
Guide. This gives you an introduction to the higher-level concepts and
features of the language. Then try to write a program that does
something dead simple, like print "Hello World!" The goal here is mainly
to make sure that you get familiar with the crappy editor and its
controls, and that you can compile and link a program. Next, you'll want
to skim the MapBasic Reference Guide with an eye toward noting where
information on specific statements and functions is. You'll be referring
to this a lot so it's a good idea to get very familiar with it. Also,
learn how to use the on-line help in parallel with this. The two
references are mirrors of each other, and if you ask me, the online help
is more accessible as you're writing code.

Once you are familiar with the tools, then take a look through the
MapBasic sample code that comes with the package. There's nothing like
trying to understand somebody else's code to teach you how to write your
own. Another resource is the MapBasic window. Many of the interactive
commands, when executed while the MB window is open, will generate the
actual MapBasic code for you and you can simply cut and paste them into
your own program.

At some point, you'll need to assign yourself little programming tasks
that take you stepwise through building a simple application to adding
more and more functionality. The example taught in the MapBasic course
is to start by writing a program that has a main() procedure and a
couple of sub-procedures. It's goal is simply to open three tables with
similar data structures (Canada, US States, and Mexico). Then you add
features like a menu, some dialog boxes to choose one of the tables for
mapping (and then thematic shading, etc.) until you have a working
application that can open and thematically shade any table according to
the user's wishes. Or you can come up with your own tasks, but the key
to learning programming is to do it ("Do or do not... There is no try."
as the wrinkled little alien said.)

And of course, if you... no, WHEN you have questions there are some
pretty good teachers here on the L, so don't hesitate to ask away!

Reply all
Reply to author
Forward
0 new messages