|
-
Jun 14th, 2008, 10:09 PM
#1
Thread Starter
Member
Range of Value
I am wondering if it is possible to set a range of value. For example, I am trying to make it so a timer checks a label for integers 1 through 5.
Instead having to write out
Code:
If Label1.Caption = "1" or "2" or "3" or "4" or "5"
is there a way I could make it so it ranges from 1 to 5?
-
Jun 14th, 2008, 10:33 PM
#2
Re: Range of Value
You can use Select Case, ie:
vb Code:
Select Case Val(Label1.Caption) Case 1 To 5 'Do something End Select
Edit, you can also do multiple ranges, ie:
Case 1 To 5, 7 To 10, etc.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|