the defualt for an array?
I think my problem to one of my programs. It array is not big enough. The number is too small.
Printable View
the defualt for an array?
I think my problem to one of my programs. It array is not big enough. The number is too small.
Use a dynamic array
This has taken an array with no elements and added, one by one, 1000 active elements.Code:Dim Arr() as Integer
for x = 1 to 1000
Redim Preserve arr(x)
arr(x) = x
next
So where do I put that in this code?
Private Sub cmdLoad_Click()
Dim i As Integer
Dim s As Integer
Dim intResponse As Integer
Let intResponse = MsgBox("Do you really want to load?", vbYesNo)
If intResponse = 7 Then Exit Sub
Open "a:baseball.dat" For Random As #1
Dim intX As Integer
intX = 1
Do Until EOF(1)
Get #1, , Player(intX)
intX = intX + 1
Loop
Let mintCount = intX - 1
Close #1
For i = 1 To 100
With Player(i)
picDisplay.Print "Name: " & Player(intX).name & s & "Average: " & Player(intX).Average & s & "At Bats: " & Player(intX).AtBats & s & "Hits: " & Player(intX).Hits 'mstrName(intX); Tab(25); mcurHours(intX); Tab(33); mcurRate(intX); Tab(42); FormatCurrency(mcurWages(intX))
End With
Next
Call cmdDisplay_Click
cmdLoad.Enabled = False
End Sub