Results 1 to 4 of 4

Thread: heeelpppppppppp

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2005
    Posts
    9

    Exclamation heeelpppppppppp

    what would the interface look like for this code?

    Private Sub Form_Load()
    Option Explicit
    Dim i As Integer
    Dim MyRecord(1 To 7, 1 To 1) As Long
    'Array 1 to 5 are the candidates
    'Array 6 is dummy votes
    'Array 7 is total votes

    Randomize

    Dim Vote As Integer

    For i = 1 To 10
    'Set caption to random a randome number from 1 to 10
    Vote = Int(10 * Rnd) + 1

    If Vote <= 5 Then

    MyRecord(Vote, 1) = MyRecord(Vote, 1) + 1

    Else

    MyRecord(6, 1) = MyRecord(6, 1) + 1

    End If

    MyRecord(7, 1) = MyRecord(7, 1) + 1

    Next

    For i = 1 To 7
    Debug.Print MyRecord(i, 1)
    Next

    End Sub
    End Sub

    would be appreaciated ! I really need help!!

  2. #2
    VB Addict Pradeep1210's Avatar
    Join Date
    Apr 2004
    Location
    Inside the CPU...
    Posts
    6,614

    Re: heeelpppppppppp

    Hi mematoots,
    welcome to the forum

    By interface u mean the form outlook?

    Anyway the code won't work. U need to correct it first. (Option Explicit inside a sub, 2 End Sub's etc.)

    Pradeep

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: heeelpppppppppp

    This was the firs run:

    0
    1
    1
    1
    0
    7
    10
    Second Run: (see the problem, yet?)

    1
    0
    1
    0
    1
    7
    10
    Last time:
    0
    0
    2
    1
    1
    6
    10
    Last edited by dglienna; May 19th, 2005 at 06:05 AM.

  4. #4
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: heeelpppppppppp

    Here's the scoop.

    1) Take Option Explicit out of the the sub and put it in the General Declarations which is the very top of the code window.

    2) Use [Highlight=VB] tags around vb code

    3) Use sensible thread titles please. Using thread titles like "Help" or "Noobie" or "Problem with my code", etc. is not good and will tend to turn people away. But using titles like "Command Button not working", or "Dividing without dividing", etc., is more specific and breif and will get you more help.

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