1.11M Members

web-Based calculator error

 
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 ?

 
0
 

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

 
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: