GAMBAS Overview

J

Jarret W. Buse

Guest
GAMBAS Overview

Many people who have been exposed to a programming language have been taught the BASIC language. For Linux users, there is a BASIC dialect available called GAMBAS.

GAMBAS stands for Gambas Almost Means BASic. For the most part, GAMBAS appears to be similar to Microsoft Visual Basic. Gambas3 is an Integrated Development Environment (IDE) which allows a programmer to write code in a source code editor, debugger, compiler, interpreter and more.

Gambas is a BASIC language with the addition of object extensions. Objects allow for the inclusion of graphical objects.

When source code is compiled, it creates a file with the 'gambas' extension but is given execution permissions. Installation packages can also be made for the following systems:

  1. Archlinux
  2. Debian
  3. Fedora/Redhat/CentOs
  4. Mageia
  5. Mandriva
  6. OpenSUSE
  7. Slackware
  8. Ubuntu/Mint
  9. Autotools (used to create single file of the source code for distribution)
NOTE: Some of these require special packages such as makepkg, automake, etc. The makepkg file was the hardest to find, but I found it at 'https://docs.google.com/file/d/0B7S255p3kFXNMS1hdEg3RzVpeEU/edit?pli=1'. Simply click on the the down arrow in the top center of the screen to download.

It should be noted that some compiled code will also create a version for Qt and GTK. If multiple distros are selected, there is a selection to create a different directory for each one.

When Gambas is started, you should see a screen similar to Figure 1.

Figure1.jpg

FIGURE 1

There is a 'Tip of the Day' which gives some great information, but it can be turned off.

As you can see, there are options to create a new project, open a project, open a recent project and open example projects.

NOTE: To make the example projects work, you need to make the 'gambas' files executable and have permissions to create files since they are compiled. One good way to do this is to copy the examples from /usr/share/gambas3/examples/ to your home folder and then load them from there.

The example files are split into various types:

  • Automation
  • Basic
  • Controls
  • Database
  • Drawing
  • Games
  • Image
  • Miscellaneous
  • Multimedia
  • Networking
  • OpenGL
  • Printing

Each of these example sections have one or many examples. By looking at the source code for the examples and running the code, you can learn quite a bit from them. Be aware of the requirements mentioned above that allow you to run the code.

Overall, Gambas can do the following:

  • Database manager – The Gambas IDE can allow access to databases from your code. Databases can be managed such as MySQL, ODBC, PostgreSQL or SQLite.
  • Graphical User Interface (GUI) integration – Gambas provides the ability to write code for GTK+ and Qt4.
  • Desktop independence – Gambas is independent of the desktop and can use themes based on the current desktop such as Gnome, KDE or XFCE.

The Gambas IDE can provide the following:

  • Automatic completion
  • Database manager
  • Documentation from wiki (online at http://gambaswiki.org/wiki)
  • GUI form editor
  • Icon editor
  • Integrated debugger
  • String translator
  • Subversion support
  • Syntax highlighter

Basically, for anyone who knows Microsoft's Visual Basic will not have much trouble using this program. There are minor differences in the language, but this is something easy to handle. The IDE is intuitive to use and similar to Microsoft. The main thing I found, which is not too big of a deal, is the documentation. It seems to me that the Gambas documentation is not as extensive as Microsoft's, but again this is not too big of a deal. These items should hopefully be handled as time goes on.

To download Gambas, it can be found in the repositories and to get the newest version, use this ppa: 'deb http://ppa.launchpad.net/gambas-team/gambas3/ubuntu trusty main'. The repository can also be added through the command-line by:

  • add-apt-repository ppa:gambas-team/gambas3

Gambas allows for the creation of GUI applications as well as command-line based programs which can be used to enhance the abilities when using your terminal.

My suggestion is for anyone who has used Visual Basic or would learn to program should try Gambas. Basic has always proved to be a powerful language and easy to learn. The abilities of Gambas provides a wonderful assortment of tools to create your own programs for the various Linux distros. I highly encourage everyone to download Gambas and give it a try even if you only look over the example programs that come with it. Some of the examples are very nice and can be compiled for your use and even modified to add more functionality.

To be honest, my computer experience started as a programmer back in the DOS days before there was a need for GUIs and objects in programming did not exist yet. Gambas is an excellent programming tool for beginners and experts.
 

Attachments

  • slide.jpg
    slide.jpg
    18 KB · Views: 206,838


Great to know! I have been a VB(All versions from VBA to .NET) and look forward to looking at this as a way to program for linux. I know there is OOo Basic, but haven't gone over too much of it, I think that is more like VBA than VB6 or .NET versions of VB. I could be wrong, though. :)
 
Great to know! I have been a VB(All versions from VBA to .NET) and look forward to looking at this as a way to program for linux. I know there is OOo Basic, but haven't gone over too much of it, I think that is more like VBA than VB6 or .NET versions of VB. I could be wrong, though. :)
I haven't heard of that one. Once I came across Gambas, I knew I had found what I needed. If I want true MS VB.NET, I use a VirtualBox environment which I use for XNA (see http://www.linux.org/threads/xna-installation-on-linux-for-visual-basic-or-c.7220/#post-24930). If you search for my articles and VirtualBox, you will see that I cover a great deal of virtualized systems (even the Mac OS on AMD, hoping to do an Intel version).

Thanks for reading and showing an interest.
 
I installed this. It's pretty cool and does follow VB like structure/syntax. I found a couple of sites for learning Gambas. Looking forward to it. Thanks for writing the article. :)
 

Members online


Top