jmonahan2009
New member
- Local time
- Yesterday, 19:48
- Joined
- Oct 6, 2011
- Messages
- 6
Hey guys. I'm taking a visual basic class in college, and I'm having trouble with some code.
I'm having trouble with the "Is <> 700 to 750" part. I'm pretty sure that the compiler stops reading it as one full statement, or what have you, after it reads the 700 part, so it doesn't see 700 to 750 as one full condition. I can't figure out how to get around this, any suggestions?
Code:
Public Class Form1
Private Sub btnFindLocation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFindLocation.Click
'Define variables
Dim callNumber As Integer
'Receive input
callNumber = CInt(CallNumberBox.Text)
'Find book
Select Case callNumber
Case 100 To 199
OutputBox.Text = "The book is located in the basement."
Case 200 To 500, Is > 900
OutputBox.Text = "The book is located on the main floor."
Case 500 To 900, [B]Is <> 700 to 750[/B]
OutputBox.Text = "The book is located on the upper floor."
Case 700 To 750
OutputBox.Text = "The book is located in the archives."
Case Else
OutputBox.Text = "The book does not exist."
End Select
End Sub
End Class
I'm having trouble with the "Is <> 700 to 750" part. I'm pretty sure that the compiler stops reading it as one full statement, or what have you, after it reads the 700 part, so it doesn't see 700 to 750 as one full condition. I can't figure out how to get around this, any suggestions?