Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

"Object reference is not set to an instance of an object"?

$
0
0
In my dice game, whenever I press a roll button, I get this error in my function to check if there is a three of a dice: "Object reference is not set to an instance of an object"

Here is my code:

Private Function checkingthreeof1() As Boolean
        For i = 0 To 5
            If faces(i) >= 3 Then 'This is where the error is
                threeof = i + 1
                checkingthreeof2(True, 0)
            End If
        Next
        Return True Or False
    End Function



I looked all over Google but couldn't find a solution.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>