
array subscript out of range
Michelle,
Quote:
> Subscript out of range
the value of i in funtion_nm is not in the range of LBound to UBound( array )
(probably higher)
Quote:
> Do While Not ...
What do you control the loop with?
--
Nic Roche
Net Extra
www.extra.net.au
=================================================
imagex - Web Imaging - activex thin client
Button Creator, Thumbnail Creator, Imaging Lite, ImageMap Creator,
MouseOver Creator, SlideShow Creator.
Properties, Methods, Events, Software Developers Kit
=================================================
Quote:
> Can anybody explain or provide a good solution to the following problem?
> In file1.asp:
> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> Dim arrMarket
> ReDim arrMarket(10)
> intArrMarketCount = function_nm(arrMarket)
> 'arrMarket may or may not contain data after calling function_nm
> If intArrMarketCount = 0 Then
> arrMarket(0)=""
> End If
> Function function_nm(arrData )
> Dim i
> i = 0
> Do While Not ...
> i = i + 1
> ...next...
> Loop
> function_nm = i
> End Function
> In file2.asp:
> ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> <%=arrMarket(0)%>
> The problem is:
> If arrMarket is null after calling function_nm, I get this error:
> Microsoft VBScript runtime error '800a0009'
> Subscript out of range
> I think I've given a default value to arrMarket(0) in file1.asp, so what
> could be the problem, and what's the best solution? Thanks.