jps services
  • Home Page
  • GIS Training Courses
    • QGIS Training Courses
    • ArcGIS Training Courses
    • MapInfo Pro Training Courses >
      • MapBasic Training Course
  • About
  • Blog

Understanding the MapBasic Main procedure  

30/10/2016

0 Comments

 
If you look up the Main procedure in MapBasic Help you will see that it is defined as the first procedure called when MapBasic is run. In the last blog, A first look at MapBasic, a Note statement was compiled and run without using this Main procedure. In that case MapBasic was run in an implicit mode. The program assumed that you needed to also run the Main procedure and therefore automatically included it. If you want to run more complex programs you will need to explicitly use the Main procedure. A more detailed explanation of implicit and explicit requirements are given within MapBasic Help so I will not repeat it here. Also I would encourage you to use the help facility to build on your understanding of MapBasic.

Before you can use procedures such as Main within your MapBasic program you must first declare them. As show in the code below:-
Picture
You could save this example as a simple template for future programs. This saves having to repeatedly type the same code and also avoids potential syntax errors.

The Main procedure controls all the other sub procedures to ensure the program runs according to the programmer’s intention. For any procedure to work in must first be declared. The Declare function defines the name and parameter list of a function. Search for the Declare function in MapBasic Help and scroll down to the example section. Here you will find a program for calculating cubes which may help improve your understanding of some basic MapBasic programming concepts

This example below is a more simplified version which covers a number of features worthy of further discussion.
Picture

Read More
0 Comments

A first look at MapBasic

21/10/2016

0 Comments

 
If you have used MapInfo then you are probably aware that there is a programming language available called MapBasic for development work.

You can now download MapBasic without charge from http://www.pbinsight.com/support/product-downloads/for/mapbasic.

​The MapBasic interface is not as sophisticated as say Visual Studio. For instance, there is no visual interface for creating dialogue boxes, buttons etc.  In fact the interface hasn’t really changed very much from the original version. However, there have been many upgrades to the functionality offered by MapBasic from a programmable view point.  These reflect improvements in MapInfo and the Windows operating system environment.
Picture
The above image shows the MapBasic interface when you first fire up the software. Most of the options are familiar if you have used Notepad or a similar product. Whilst the interface is minimal the underlying software program is very powerful.
Picture
If you are new to MapBasic I suggest you click on the Help tab and select Contents. This first page introduces MapBasic and also shows you what is covered by the help option. If you have never programmed before then you may not agree with the statement in this section that MapBasic is ‘an easy to use programming language.’ This statement applies more to how MapBasic compares with say  C++ or Pascal programming languages.

​Even if you have never programmed before, you should still be able to learn enough about MapBasic from the Help screens to achieve some success in automating common mapping requirements. Most features of the program have some code snippets explaining how to use them within the help section.

Read More
0 Comments

    Author

    Joe Short BSc has been involved with various mapping solutions for over twenty years.  If you are considering implementing a GIS  or have ArcGIS Pro, MapInfo Pro or QGIS training requirements, jps services would be happy to be of assistance to your organisation. 

    Archives

    April 2020
    March 2020
    October 2019
    September 2019
    August 2019
    July 2019
    March 2019
    November 2018
    October 2018
    August 2018
    July 2018
    November 2017
    October 2017
    September 2017
    July 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    May 2016
    February 2016
    September 2015
    August 2015
    April 2015
    February 2015
    November 2014
    October 2014
    July 2014
    June 2014
    May 2014
    March 2014
    February 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    June 2013
    May 2013
    April 2013
    February 2013
    December 2012
    October 2012
    September 2012
    August 2012
    July 2012

    Categories

    All
    Arc Gis
    Arcview
    Autodesk
    Cad
    Gis Training
    Local Government
    Mapbasic
    Mapinfo
    Quantum Gis
    Relational Databases
    Saga Gis

    RSS Feed