|
-
Oct 4th, 2001, 09:37 PM
#1
Thread Starter
Addicted Member
How Do I Change ???
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.
-
Oct 4th, 2001, 10:14 PM
#2
Use a dynamic array
Code:
Dim Arr() as Integer
for x = 1 to 1000
Redim Preserve arr(x)
arr(x) = x
next
This has taken an array with no elements and added, one by one, 1000 active elements.
-
Oct 4th, 2001, 10:29 PM
#3
Thread Starter
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|