David,
You need to make sure you are not going beyond the array bounds, the error
you are getting is because you are not doing so.
Use the UBound() function that returns the last index within the array's
dimension. So, if the array contains 20 elements, the UBound function will
return 19.
lastIndex = UBound(someArray, 1)
Look up the VB help for more info on the method.
--
Manohar Kamath
Editor, .netBooks
www.dotnetbooks.com
"David P. Jessup" <davidATimntDASHtechDOTcom> wrote in message
news:OnGafUckDHA.3732@tk2msftngp13.phx.gbl...[color=blue]
> Good day folks.
>
> Within an ASP I'm working on I need to check whether an array is empty or
> not.
>
> Code:
> Dim somearray()
> 'other code: array might have been populated, maybe not
> if somearray() <> "" Then 'this is the line that hangs debugging using[/color]
VID[color=blue]
> 'code if array is populated
> else
> 'code if array is empty
> end if
>
> My problem is coming up when I debug(Using VID) I get this error:
> An exception of type 'Microsoft VBScript runtime error: Subscript out of
> range' was not handled.
>
> But when I actually launch the page I don't get any errors. Of course if[/color]
I[color=blue]
> put in On Error Resume Next, and I run in debug mode I don't get any[/color]
errors[color=blue]
> through VID and I still obviously I don't get any errors launching the[/color]
page.[color=blue]
>
> Thanks for any insight from this ASP Newbie
>
>[/color]