• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

If Statement condition not matching up

I declare my indvalue however if my value has a valid value of say 2300 it will still go into the _badresponse = true

Why is this?
Public indvalue As Integer
 If indvalue = 0 Or 6912 Then
                _BadResponse = True
                Exit Sub
            End If

Open in new window

0
cmdolcet
Asked:
cmdolcet
  • 3
1 Solution
 
jpaulinoCommented:
Try this way:
 If indvalue = 0 Or indvalue = 6912 Then
       _BadResponse = True
       Exit Sub
 End If

Open in new window

0
 
jpaulinoCommented:
Opps!
 If indvalue = 0 Or indvalue = 2300 Then
       _BadResponse = True
       Exit Sub
 End If

Open in new window

0
 
cmdolcetAuthor Commented:
your solution is confusing. I want it to omit that loop if its anything but 0 or 6912......if the reading is 2300 its a good reading....but for whatever reason it enters the current loop i have built
0
 
jpaulinoCommented:
If you want to end the loop in a value (indvalue) is 0 or 6912  then my first post is ok.
0
 
AbhishekoopsCommented:
If indvalue = 0 Or indvalue = 6912 Then
       _BadResponse = True
       Exit Sub
 End If
this wud solve your problem but even if this does clear it then fix a break point and go for step by step debugging and check the values in the Locals window or in the Immediate window.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now