Solved

# If Statement condition not matching up

Posted on 2009-04-15
186 Views
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

Exit Sub

End If
``````
0
Question by:cmdolcet

LVL 48

Expert Comment

Try this way:
`````` If indvalue = 0 Or indvalue = 6912 Then

Exit Sub

End If
``````
0

LVL 48

Accepted Solution

Opps!
`````` If indvalue = 0 Or indvalue = 2300 Then

Exit Sub

End If
``````
0

Author Comment

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

LVL 48

Expert Comment

If you want to end the loop in a value (indvalue) is 0 or 6912  then my first post is ok.
0

LVL 1

Expert Comment

If indvalue = 0 Or indvalue = 6912 Then
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

### Suggested Solutions

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…