"subscript out of range"
this msg is confuonding us. in one machine (IIS 3.0, SP3, NT4.0) it runs
perfectly well. but when copywebbed using interdev on another machine
(running same specs as first machine), we get the subscript out of range
error.
below is the error msg and the code. when we comment out the erring lines,
the webpages load just fine, albeit with the missing dates that are being
extracted from the code below.
additional background. the main asp code generates a word document out of a
word template. data is extracted from SYBASE and merged into datafields
inside the word template.
the checking in the code below is necessary because some of the fields are
blank and some contain null characters, which annoy the ASP.
hope u can help us.
----------
Microsoft VBScript runtime error '800a0009'
Subscript out of range
/projects/incProcEventDate.txt, line 20
---------
contents of incProcEventDate.txt
<%
Function Processing_Date(actual_dt, projected_day,
projected_month_yr)
actual_dt = Trim(actual_dt)
projected_day = Trim(projected_day)
projected_month_yr = Trim(projected_month_yr)
If (NOT ISNULL(actual_dt)) AND (NOT actual_dt = "")
AND (NOT actual_dt = " ") AND (NOT actual_dt = " ")
AND (NOT actual_dt = " ") Then
arrDate = Split( actual_dt, "-", 3 )
Processing_Date = arrDate(0) & " " & arrDate(1) & " " & arrDate(2)
ElseIf (ISNULL(actual_dt)) AND (NOT
ISNULL(projected_day)) AND (NOT
ISNULL(projected_month_yr)) Then
arrDate = Split( projected_month_yr, "-", 3 )
If (NOT ISNULL(projected_day)) AND (NOT projected_day = "") AND (NOT
projected_day = " ") AND (NOT projected_day = " ") AND (NOT projected_day =
" ") Then
Processing_Date = projected_day & " " & arrDate(1) & " " & arrDate(2)
'>>>>>>line 20
Else
Processing_Date = arrDate(0) & " " & arrDate(1) & " " & arrDate(2)
End If
Else
Processing_Date = " "
End If
End Function
%>