Learning to program with Gambas.

programming

Gambas is a free programming language derived from BASIC (hence prawns means Gambas Almost Means Basic). It is distributed under the GNU GPL. Notably it presents certain similarities with Java since the execution of any application, a set of libraries previously installed interpreter (Gambas Runtime) understand the bytecode of the applications developed and become executable code by the computer is required. On the other hand, unlike Java, no slowdowns are experienced and can develop large applications in no time.

This time I will teach you how to make a small program for calculation note and take the average, then slowly I will go by the other contributions, to learn to Save, Edit, View and Delete records in a database (Mysql ) fails to input files and databases that will use in each post to make them easier to examples (type copy and paste lol) na just kidding. but that support for those who are starting.

Type then select "Application Chart" and mark "Access databases" else is left as is as shown in the image.

On the next screen should indicate the folder where you want to save the project. I think a call "Calnota", select the folder and give "Next as the following.

Now we question that we want to name the new project and the title, I use the same "Calnota"

Here it indicates that the project was created.

Here it shows us our visual environment.

We started designing our program:

We will create about 8 Labels, and one ComboBox 7 TextBox, and 1 Button, as shown in the image.

We put the names to each label and button so we must go selecting each and go to the right side in properties we locate the "Text" property there place the name we want to appear when the program is run, this is done for each of the labels and also for the button.

To place the options in the combo box, select it and use the property list, here we go adding the options we want to appear.

We can run the program and see something like this.

Now if only programmed to perform the calculation of the average of the 4 notes, for this double-click the calculate button we created, we add the following code:

 .Public Sub Button1_Click () A = TextBox3.Text B = TextBox4.Text C = TextBox5.Text D = TextBox6.Text P = (A + B + C + D) / 4 TextBox7.Text = P End

That code is very easy to understand even for those who are beginning to program (one must have some logic. We must declare the variables that we have used (A, B, C, D, P):

 Public A As String As String Public B As String Public C As String Public D As String Public P

All Our code will be something like.

  

Done this you can run our program to test if it works.

Interesting about Gambas

Install the latest version of Gambas on Ubuntu and begins to program applications

-whose acronym is prawns "Gambas Almost Means Basic" - is analogous to Visual Studio on Windows. It is a visual programming environment -derived BASIC and very like Java- allows us to develop applications easily...

Read more...

Gambas: Visual Programming GNU / Linux

Many who schedule or learn to program, either this profession, hobby or whatever, if we come from Windows (most secure) use is that some see or hear the well-known: Visual Basic...

Read more...

Learning to program with Gambas

Gambas is a free programming language derived from BASIC (hence prawns means Gambas Almost Means Basic). It is distributed under the GNU GPL. Notably it presents certain similarities with Java...

Read more...

up