Gambas is almost Basic on Linux, and for those Visual Basic programmers looking to move from Windows to Linux then this may be the final push that they need.
Any Visual Basic programmers considering moving (sensibly) from Windows to Linux may well be put off by the thought of having to relearn all of their programming skills and techniques. Fortunately that's no longer a problem - now the Visual Basic programmer only needs to install Gambas, and within minutes they can be up and running with very little loss of productivity.
Is Gambas just a Visual Basic Clone?
The first thing that Gambas' founder Benoit Minisini is keen to point out is that Gambas is not a VB clone (and is in fact not compatible with Visual Basic) - he's also keen to point out that Gambas is a language like Visual Basic under Linux; hence his motto: Gambas almost means Basic.
Installing Gambas
There are two ways to obtain Gambas:
- use the Linux installer for each particular version of Linux to download the distribution's most current version (using apt-get, yast, yum, etc)
- obtain completely up to date versions at the Gambas web site - http://gambas.sourceforge.net
So, for example, the easiest way to install Gambas on a Debian Linux PC is to go to the command line and type:
sudo apt-get install gambas
Running Gambas
Running Gambas from the command line is simple - it's just a matter of knowing which version has been installed, and so that will be one of the folllowing:
gambas
gambas2
There are no issues with having both versions installed (to compare the differences and test code, for example).
The Gambas IDE
The Gambas IDE (Integrated Design Environment) is simple, clean and any Visual Basic programmer will feel completely at home with it - even someone new to programming will undanted by it - it looks like it should be easy to use, and it is.
The IDE consists of:
- the project window - used to manage the forms and code that make up a Gambas application
- the tool box - objects, such as buttons, can be draged and dropped onto forms
- the properties window - used to modify the properties of objects (such as button names and displayed text)
- the form design window - used to create the objects on the form (for example buttons, combo boxes and labels)
- the class code window - used to create code for forms
Creating a Simple Gambas Form
The best way to learn any programming languages is to just start typing and Gambas is no different - even the complete novice can develop a professional looking GUI (Graphical User Interface) in a very small amount of time; for example creating a simple form couldn't be easier:
- use the projects window to create a new form
- drag and drop a button from the tool box onto the new form
- use the properties window to change the text displayed on the button
- double-click the button to edit its associated code
- press the run button on the projects window to see the end result
And Finally - Dealing with the Gambas Mascot
A minor issue, but one which can be a little irritating for some people, is the mascot - a blue prawn that sits on the screen smiling and winking. Anyone who is particlarly distracted by it may turn it off by doing the following:
- click on Tools
- click on Preferences
- go to the Others tab
- under Miscellaneous uncheck "Show mascot"
And that's all there is to care free, almost Visual Basic programming on Linux.
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you so much for the guide.
Great guide. For simple applications porting a VB.Classic application to Gambas is actually easier than converting it/them into VB.Net. Just for fun, I have done this to eight of my simple apps. Gambas syntax is nearly identical to VB.Classic and many instances IT IS actually identical.
Also, if you are not ready for Linux then give FreeBasic a shot. There are several free and fully featured WinOS based IDE's for it.
Your contribution cannot be approved because it does not follow the Utopian Rules.
Your selected Repo hasn't committed since 2015. According to Utopian.io's new rule, the selected repo's latest commitment should not exceed 1 year.
You can contact us on Discord.
[utopian-moderator]