'thanks
'Declaration of variables and arrays as public
Public AmountclubYear( 4, 0) As Decimal
Public club(4) As Integer
Public Year() As Integer
Public InputStartingYe ar As Integer
Public InputFinalYear As Integer
Public x As Integer
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'store the name of each club
club(0) = "r54000"
club(1) = "r54001"
club(2) = "r54002"
club(3) = "r54003"
club(4) = "r54004"
'user enters start and final year,
InputStartingYe ar = InputBox("Pleas e enter the starting year.")
InputFinalYear = InputBox("Pleas e enter the final year.")
'Program to calculate the number of years
x = InputStartingYe ar - InputFinalYear
'redim
ReDim Year(x)
End Sub
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
End Sub
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
'the user will be prompted by input boxes for cost
For club = 0 To 4
For Year = 0 To x
AmountclubYear( club, Year) = _
CDec(InputBox(" Enter the cost incurred for club ",
club, " and year ", Year))
Next Year
Next club
End Sub
End Class
Armin Zingler wrote:
"portroe" <bo*@sleigh.com > schrieb
my 2-dimensional array, is given me the following error message,
'For' loop control variable cannot be of type '1-dimensional array
of
String'.
has anybody got a tip on what I have incorrect,
Please post Code.