Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


CASE - checking for a range ?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-21-2008, 08:54 PM
Knows the basics
 
Join Date: Apr 2008
Location: Duesseldorf, Germany
Posts: 71
Default CASE - checking for a range ?

Hello,

my forum search did not present a solution, so 'm sorry if the answer is already somewhere in a post.

Can i make CASE checking for a range of numbers instead of a single number..?

Example:

Select Value

Case 0-33: do something

Case 34-70:do something else

End Select

This means: if value is somewhere in the range between 0 to 33, then...


Is this possible..? and if so, how is the correct syntax for this..?an
If not, how can i check for a range without tons of If..then statements..?



cheers

TWELVE
Reply With Quote
  #2 (permalink)  
Old 06-21-2008, 09:00 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,186
Default

Case checks for district values.
You can not use it for checking range of numbers.
Reply With Quote
  #3 (permalink)  
Old 06-21-2008, 10:21 PM
Senior Member
 
Join Date: Mar 2008
Posts: 114
Default

I guess (me again stating the obvious) that you could kludge it ...

Quote:
sub Main()

CheckMyNum

Select Value
Case "0033": do this
Case "3470": do that
Case Else: do theother
End Select

End Sub

sub CheckMyNum()
Value = "Else"
if mynum >=0 and mynum <=33 then value = "0033"
if mynum >=34 and mynum <=70 then value = "3470"
end sub

Last edited by badkarma : 06-21-2008 at 10:24 PM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking if registry key exists? N1c0_ds Questions & Help Needed 3 10-21-2008 06:30 AM
Checking available fonts? MitchDabo Questions & Help Needed 5 02-10-2008 11:43 PM
checking textbox string derez Questions & Help Needed 13 10-25-2007 12:58 PM
About Select ... case JJM Questions & Help Needed 2 05-22-2007 07:55 AM
Index was out of range error in version 5 HARRY Questions & Help Needed 6 05-20-2007 09:16 AM


All times are GMT. The time now is 03:12 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0