"select...case", multiples cases not possible ? 
Author Message
 "select...case", multiples cases not possible ?

I have the following straight vb code, which works:

            Select Case (CInt(oRecordSet.Fields(x).Type))
                Case 2 To 7, 11, 10, 14, 16 To 21, 72, 131, 133 To 135
                    arrFld(2) = CInt(-1)
                Case Else
                    arrFld(2) = (oRecordSet.Fields(x).DefinedSize)
            End Select

But, i keep getting an error when using this code within VBScript on
my ASP.
Is the "Case 2 To 7, 11, 10, 14, 16 To 21, 72, 131, 133 To 135" line
not possible?  Will i need to use individual cases for each of these,
including the "2 To 7" parts?  Like, Case 2, Case 3, Case 4...  I hope
not.

I searched MSDN's mention of this in the VBScript reference
( http://www.*-*-*.com/ )
but the example seems too simple for my use.

Any ideas what i'm doing wrong ?




Sun, 07 Aug 2005 22:16:46 GMT  
 "select...case", multiples cases not possible ?
Quote:

> I have the following straight vb code, which works:

>             Select Case (CInt(oRecordSet.Fields(x).Type))
>                 Case 2 To 7, 11, 10, 14, 16 To 21, 72, 131, 133 To 135
>                     arrFld(2) = CInt(-1)
>                 Case Else
>                     arrFld(2) = (oRecordSet.Fields(x).DefinedSize)
>             End Select

> But, i keep getting an error when using this code within VBScript on
> my ASP.
> Is the "Case 2 To 7, 11, 10, 14, 16 To 21, 72, 131, 133 To 135" line
> not possible?  Will i need to use individual cases for each of these,
> including the "2 To 7" parts?  Like, Case 2, Case 3, Case 4...  I hope
> not.

> I searched MSDN's mention of this in the VBScript reference

(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/scri...
vsstmselectcase.asp)

Quote:
> but the example seems too simple for my use.

> Any ideas what i'm doing wrong ?



It's not the list of values, it's the "To". You'll have to expand those to
actual values.

Case 2, 3, 4, 5, 6, 7, 11, 10, 14, 16, 17, 18, 19, 20, 21, 72, _
     131, 133, 134, 135

--
Steve

In matters of conscience, the law of majority has no place. -Mahatma Ghandhi



Mon, 08 Aug 2005 02:26:30 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Advice needed : Simple Database

2. tp7 newby. tvdemo help.

3. VBScript Select Case vs VB Select Case

4. Switch/Case with multiple tests in case

5. Select Case and Case 0 To 9

6. Problem with mouse control with SVGA

7. multithreading with com

8. "Case Is" causing error

9. Help w/"title case"

10. Select Case with multiple string criteria

11. listviews / multiple forms / select case - HELP!!

12. Select case not working

 

 
Powered by phpBB® Forum Software