Results 1 to 8 of 8

Thread: [RESOLVED] Null Reference Exception Help.

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2011
    Posts
    127

    Resolved [RESOLVED] Null Reference Exception Help.

    Hey i keep getting this null reference exception error and i can't figure out what i need to do to fix it.

    I have this in the form
    Code:
            Private Sub cbLookUp_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbLookUp.Click
            Dim webDownload As New Net.WebClient
            Dim strHtml As String
            Dim strSkillSet() As String
            Dim strSkillData() As String
            Dim i As Integer
            'Dim a As Integer
            Dim lol As Control() = clsArray.getMixedControlArray(Me, "lblHS")
            strHtml = webDownload.DownloadString(strHighscores & txtUsername.Text)
            strSkillSet = Split(LCase(strHtml), " ")
            For i = 0 To UBound(strSkillSet)
                strSkillData = Split(LCase(strSkillSet(i)), ",")
                'For a = 0 To UBound(strSkillData)
                    strHSData(i).intRank = strSkillData(0)
                    strHSData(i).intLevel = strSkillData(1)
                    strHSData(i).intXp = strSkillData(2)
                'Next
                lol(i).Text = strHSData(i).intLevel
            Next
        End Sub
    and this in a module:
    Code:
        Public strHSData() As HighScores
    
        Public Structure HighScores
            Public intRank
            Public intLevel
            Public intXp
        End Structure
    Throw's the error on the first loop.
    Thanks
    Last edited by FredFrothen; Feb 4th, 2011 at 01:37 PM.
    EXPERIENCED VB6 CODER
    IF YOU SEE ANY FAILURE IN MY CODING, PLEASE LET ME KNOW AS I'VE ONLY JUST STARTED LEARNING VB.NET AND I WILL APPRECIATE ANY HINTS AND TIPS YOU HAVE TO OFFER!

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