QUOTE(Louisda16th @ 27 Nov, 2007 - 09:59 AM)

Are you saying you want a dynamic array (an array which changes its size as and when you want). Post your code so that we can see if there's a problem in it.
I am getting an expression expected error right here (marked in red) for some reason. I think I need to add a input box that asks the user how many grades they want to add. Just not sure how to do this. Here was my original problem also:
Create an application, save as GradeCalculator, that has the user press a EnterGrades button and enter in values in an input box. As you are entering values, they should be stored in an array.
When you are finished entering grades, have the cancel button return you to the program.
There should be a second button, CalcAvg, that calculates the average score and displays the grades and their average in a label on the form.
CODE
Public Class mainForm
'module-level array
Private gradeValues As String
Private Sub exitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitButton.Click
Me.Close()
End Sub
Private Sub enterButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles enterButton.Click
'allows users to enter grades
' stores the grades in the module-level
' gradeValues array
For subscript As Integer = 0 To gradeValues.Length - 1
gradeValues(subscript)[color=#FF0000]=[/color]
InputBox("Grade Value:", "Grade Values")
Next subscript
End Sub
Private Sub calculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles calculateButton.Click
'displays grades and calculated average grade
Dim gradeValues() As Integer = {}
Dim gradeAccumulator As Integer
Dim averageGrade As Double
' accumulates total grades
For Each grade As Integer In gradeValues
gradeAccumulator = gradeAccumulator + grade
Next grade
' displays grades and calculates average grade
For Each grade As String In gradeValues
gradeLabel.Text = gradeLabel.Text & grade & ControlChars.NewLine
Next grade
averageGrade = gradeAccumulator / gradeValues.Length
avggradeLabel.Text = Convert.ToString(averageGrade)
End Sub
End Class