Additional Notes   

 

A ListBox is a control that displays a series of Strings.

The line lstDisplay.Items.Clear uses method Clear to empty the contents of the ListBox named lstDisplay.

Method listbox.Items.Insert or listbox.Items.Add adds a String to a ListBox.

Visual Basic constant vbTab represents a tab. Visual Basic constants are prefixed with vb and are provided for many commonly used features.

Format "FormatCurrency" displays a dollar sign, $, two places to the right of the decimal point and commas after every three digits.

Function DateTime.Now returns the current system time and date.

Function DateTime.Now.Year returns the current year.

Ex. Console.WriteLine("Program started at: " & DateTime.Now.ToLongTimeString)

Function Space creates and returns a String containing spaces–the value passed to Space specifies the number of spaces to create.  ex. Space(10)

Testing and Debugging Tip 

During the debugging process it is often helpful to "comment out" selected portions of your code that you suspect may contain an error.   Running your program with selected lines commented repeatedly will often allow you to "zero in" on an error.

 

Good Programming Practice

Do not use variables of type Single or Double to perform monetary calculations. The imprecision of floating-point numbers can cause errors that will result in incorrect monetary values. Type Decimal should be used for monetary amounts.