Why won't this code add an element to the array "numbers"?
Dim numbers() As Double
Dim counter As Integer
Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
Const BASE As Double = 200 'base pay
Const COMM As Double = 1.09 'commission rate
Dim gross As Double = txtSalesAmount.Text 'user input (gross sales)
Dim pay As Double = BASE + (gross * COMM) 'calculates total pay
numbers(counter) = pay
counter += 1
txtSalesAmount.Text = ""
All I get is the dreaded exception:
An unhandled exception of type 'System.NullReferenceException' occurred in Salary_Summary.exe
Additional information: Object reference not set to an instance of an object.
As you can tell I am a complete novice.....sorry if this is trite.