Tags

, , , , , , , , , ,

Over the coming months I’ll be doing a lot of software development with the Visual Basic programming language. Even though I’m not very fond of Microsoft, VB programming is part of a course, and it’s a chance to create my first .exe files.

As far as programming goes, creating stuff with Visual Basic is pretty easy, as I’m using an IDE (Visual Studio 2008) that already has pre-written code for creating the interface objects, so it’s a case of dragging the objects into place, changing their properties and adding further code to each one to make them interact so we have a program that does stuff.

Visual Basic programs are event-driven, and they aren’t executed sequentially. The code for each interface object is run depending on what’s being clicked in the window. For example, if we’re creating a window containing a button and text box, we can modify the button code to make it change the state of the text. The following code would be run only when the button is clicked:
TextBox.Show = True

Of course, this can be taken further, so that arithmetic stuff like addition, multiplication, etc. can be performed when a button is clicked, and the text box can change state to show the result. e.g.
We could add the following code to a results button to read from a text box and change its state to show the output from a simple addition:

Num1 = TextBox
Num2 = TextBox
Num3 = Num1 + Num2
TextBox.Show = Num3

Earlier this week I’ve started posting my VB projects to SourceForge.net, which are just example programs. The only problem is the source code for each program is saved as a directory containing a shitload of files and several sub-directories, which is why I’ve uploaded them as .zip archives.
More useful applications will be posted in the near future and compiled .exe programs.

Advertisements