Building a Console Application in Visual Basic 2008

Someone emailed me this question:

“I need to create a visual basic console application that the user enters two number, then the program will display the numbers between the two number entered”

I came out with the following code:

Sub Main()
Dim x, y, p, m, n As Integer
x = 56
y = 35
m = x – y
For n = 1 To m
p = x – n
Console.WriteLine(p)
Next
End Sub

Running the code will generate all the integers between the two numbers.

Errors Handling in Visual Basic

Error handling is an essential procedure  in Visual Basic programming because it can help make the program error-free. An error-free program can run smoothly and efficiently, and the user does not have to face all sorts of problems such as program crash or system hang.

Errors often occur due to incorrect input from the user. For example, the user might make the mistake of attempting to ask the computer to divide a number by zero which will definitely causes system error. Another example is the user might enter a text (string) to a box that is designed to handle only numeric values such as the weight of a person, the computer will not be able to perform arithmetic calculation for text therefore will create an error. These errors are known as synchronous errors.

Therefore a good programmer should be more alert to the parts of program that could trigger errors and should write errors handling code to help the user in managing the errors. Writing errors handling code should be considered a good practice for Visual Basic programmers, so do not try to finish a program fast by omitting the errors handling code. However, there should not be too many errors handling code in the program as it create problems for the programmer to maintain and troubleshoot the program later.

Creating Business Application

The use of ICT applications is ubiquitous in the increasingly competitive and interconnected business world. Most companies use computers to support their business activities like marketing, accounting, financial planning, preparing payroll, procurement, order processing and more. Though commercial applications are available in the market, most business organizations need tailored made applications to suit their specific needs. As a matter of fact, many companies employ programmers to create the applications for them.

Indeed, the demand for computer programmers is on the the rise as more companies are adopting ICT applications especially in the area of e-commerce. Therefore, If you like programming, the chance to get a programmer job is very high.You don’t have to be a computer science graduate to be a business applications programmer, what you need is having interest and willingness to learn programming is enough.

VB is one of the most popular computer languages that can be used to create business applications. Using VB, you can create any customized business programs such as payroll, order processing system, accounting software, financial calculator and more. You have already learned some of those applications in our free tutorials. However, we will dwell deeper into creating more complicated business applications in our coming new lessons. Please check back often for updates.

Donation

Thank you for using our website as a platform for learning Visual Basic programming. You might be a student who is learning Visual Basic to prepare for an exam, a programmer who is trying to get some ideas to create a project for your organization, an expert programmer of other computer languages who is trying to master Visual Basic or you might be just a pure hobbyist in Visual Basic, we are pretty sure you have benefited from our site in on way or another.

We are making our utmost effort to maintain and upgrade our site from time to time to make it useful and relevance for you. However, as we are running a free website, we are facing financial difficulties especially in paying our server and hosting fees that runs to thousands of dollars. We also need to pay our freelance programmers for contributing their ideas and programs. Therefore, to keep the site going and to further develop this site, we sincerely hope that you can help us financially making a donation to us, any amount is appreciated.

If you wish to donate, please click on the button below, thank you.