We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,901 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

web-Based calculator error

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 ?

2
Contributors
2
Replies
6 Hours
Discussion Span
6 Months Ago
Last Updated
3
Views
Question
Answered
conanzz
Newbie Poster
23 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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

JorgeM
Industrious Poster
4,009 posts since Dec 2011
Reputation Points: 294
Solved Threads: 544
Skill Endorsements: 115

yes, :)

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

thanks

conanzz
Newbie Poster
23 posts since Jul 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 6 Months Ago by JorgeM

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0895 seconds using 2.69MB