"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