Solved

Select in range in VBScript

Posted on 2000-03-25
1
259 Views
Last Modified: 2006-11-17
How do I select within a range in VBScript?

*************************
Dim intInteger

intInteger = 5

Select Case intInteger
     Case 1 to 5
            'do something
     Case 6 to 10
            'do something else
End select

******************

Also tried with Cint(intInteger) and tried many strategies like
1 or 2 or 3 or 4 or 5

and

>0 & <6

etc.

Did we just get shafted on this one, or is something I'm missing?

Thanks

ic
0
Comment
Question by:ic
1 Comment
 
LVL 1

Accepted Solution

by:
mahno earned 20 total points
Comment Utility
Hi ic,

U can select using

Dim intInteger

intInteger = 5

If intInteger >= 1 And intInteger <= 5 Then
            MsgBox "do something"
ElseIf intInteger >= 6 And intInteger <= 10 Then
            MsgBox "do something else"
End If

---Or---

Select Case intInteger
     Case 1,2,3,4,5
            MsgBox "do something"
     Case 6,7,8,9,10
            MsgBox "do something else"
End select

Hope that helps,
  mahno

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
fix34  challenge 9 95
Delphi Mdi application Child forms get behind control 7 110
find a node in VST 2 46
array6 challenfge 6 62
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now