Results 1 to 3 of 3

Thread: How Do I Change ???

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    NY State
    Posts
    145

    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.

  2. #2
    jim mcnamara
    Guest
    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2001
    Location
    NY State
    Posts
    145
    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
  •  



Click Here to Expand Forum to Full Width