1,105,320 Community Members

web-Based calculator error

Member Avatar
conanzz
Newbie Poster
23 posts since Jul 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I`ve done all the work and the numbers appear in the textbox, but when I press equl it does not give the result!

Protected Sub EqlBtn_Click(ByVal sender As Object, ByVal e As EventArgs) Handles EqlBtn.Click
        If txtentr.Text.Length > 0 Then
            Select Case Vals
                Case 1 ' 
                    txtentr.Text = Store / Val(txtentr.Text)
                Case 2
                    txtentr.Text = Val(txtentr.Text) * Store
                Case 3
                    txtentr.Text = Store - Val(txtentr.Text)
                Case 4
                    txtentr.Text = Val(txtentr.Text) + Store
            End Select

        Else
            txtentr.Text = String.Empty
        End If

        'store is the first number entered.

where is the problem here ?

Member Avatar
JorgeM
IT Addict
6,404 posts since Dec 2011
Reputation Points: 581 [?]
Q&As Helped to Solve: 958 [?]
Skill Endorsements: 172 [?]
Moderator
Featured
Sponsor
 
0
 

You have references to 'Store' and 'Val'. Are you sure that these variables have been initiated properly and they have values?

Member Avatar
conanzz
Newbie Poster
23 posts since Jul 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

yes, :)

I solved the problem by using if statments and instead these 2 varialbes I used textbox and label and solved it :)

thanks

Question Answered as of 1 Year Ago by JorgeM
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: