|  |
09-18-2003, 08:16 AM
|
#1 (permalink)
|
Newb Techie Join Date: Sep 2003 Posts: 7
| Microsoft VBScript runtime (0x800A0009) Subscript out of range: '[number: -1]' Microsoft VBScript runtime (0x800A0009) Subscript out of range: '[number: -1]'
any Ideas ?
any help would be useful |
| |
09-18-2003, 08:36 AM
|
#2 (permalink)
|
Banned Join Date: May 2003 Posts: 105
| Where are you seeing this message? Is it client side code that you can enable the debugger to step through the code to determine the offending statement. |
| |
09-18-2003, 09:14 AM
|
#3 (permalink)
|
Newb Techie Join Date: Sep 2003 Posts: 7
| Re: Jack's reply the code is server side and I see this when I access a TAB on my page.
Thanks |
| |
09-18-2003, 11:32 AM
|
#4 (permalink)
|
Banned Join Date: May 2003 Posts: 105
| This is your server side code?
Yes, than I generally fall back to my 'old' debugging techniques and inserting debug statements around any code that utilizes an index, displaying the index and its value. that way at least you can determine where the code is failing.
If you cannot determine the general area where the code is failing then insert debug stmts in the main sections of the code to narrow down to a section and continue until you get to the specific section. |
| |
09-18-2003, 11:38 AM
|
#5 (permalink)
|
Newb Techie Join Date: Sep 2003 Posts: 7
| here is the code
response.write replace(ccell,"</td>","")
response.write "<span id=" & q & "spanHeader" & q & " style=" & q & "display:block" & q & ">" & cr
If Len(sHeader) > 0 Then
A_HEADERS = Split(sHeader, C_PARENT_SEP)
iHeadCount = UBound(A_HEADERS,1) + 1
response.write replace(ctblnopad, ">", " height=" & q & "30px" & q & " style=" & q & "background-color:lightgrey" & q & ">")
response.write replace(crow,"</tr>","")
A_HEADER = Split(A_HEADERS(i - 1), C_CHILD_SEP)
response.write replace(ccell,"</td>","")
response.write A_HEADERS(2)
response.write replace(ccell,"<td>","")
response.write replace(ccell,"</td>","")
response.write replace(ccell,"<td>","")
response.write replace(crow,"<tr>","")
response.write ctblend
End If
response.write replace(ccell,"<td>","")
response.write replace(ccell,"</td>","")
response.write replace(ctblnopad, ">", " height=" & q & "30px" & q & " style=" & q & "background-color:lightgrey" & q & ">")
response.write replace(ccell,"</td>","")
response.write A_HEADERS(0)
response.write replace(ccell,"<td>","")
response.write replace(ccell,"</td>","")
response.write A_HEADERS(1)
response.write replace(ccell,"<td>","")
response.write ctblend
response.write replace(crow,"<tr>","")
response.write replace(crow,"</tr>","")
response.write replace(ccell,"</td>","")
the following is the array which is at the top of the code
LoadFrame "", "","Username"& C_PARENT_SEP & "Hour(s) Connected" & C_PARENT_SEP & "Username"& C_PARENT_SEP & "Failed Attempts", c_LAYOUT_DISPLAYSPLITFRAME |
| |
09-18-2003, 11:39 AM
|
#6 (permalink)
|
Newb Techie Join Date: Sep 2003 Posts: 7
| sorry code has screwed up your display |
| |
09-18-2003, 11:40 AM
|
#7 (permalink)
|
Newb Techie Join Date: Sep 2003 Posts: 7
| array is here
LoadFrame "", "","Username"& C_PARENT_SEP & "Hour(s) Connected" & C_PARENT_SEP & "Username"& C_PARENT_SEP & "Failed Attempts", c_LAYOUT_DISPLAYSPLITFRAME
faulty code here
response.write replace(ccell,"</td>","")
response.write "<span id=" & q & "spanHeader" & q & " style=" & q & "display:block" & q & ">" & cr
If Len(sHeader) > 0 Then
A_HEADERS = Split(sHeader, C_PARENT_SEP)
iHeadCount = UBound(A_HEADERS,1) + 1
response.write replace(ctblnopad, ">", " height=" & q & "30px" & q & " style=" & q & "background-color:lightgrey" & q & ">")
response.write replace(crow,"</tr>","")
A_HEADER = Split(A_HEADERS(i - 1), C_CHILD_SEP)
response.write replace(ccell,"</td>","")
response.write A_HEADERS(2)
response.write replace(ccell,"<td>","")
response.write replace(ccell,"</td>","")
response.write replace(ccell,"<td>","")
response.write replace(crow,"<tr>","")
response.write ctblend
End If
response.write replace(ccell,"<td>","")
response.write replace(ccell,"</td>","")
response.write replace(ctblnopad, ">", " height=" & q & "30px" & q & " style=" & q & "background-color:lightgrey" & q & ">")
response.write replace(ccell,"</td>","")
response.write A_HEADERS(0)
response.write replace(ccell,"<td>","")
response.write replace(ccell,"</td>","")
response.write A_HEADERS(1)
response.write replace(ccell,"<td>","")
response.write ctblend
response.write replace(crow,"<tr>","")
response.write replace(crow,"</tr>","")
response.write replace(ccell,"</td>","") |
| |
09-18-2003, 12:01 PM
|
#8 (permalink)
|
Banned Join Date: May 2003 Posts: 105
| You set iHeadCount = upper bound of A_HEADERS + 1
but later you access A_HEADERS with i-1, 0, 1, and 2 as the index.
Is there code missing that checks for iHeadCount -1 <= (i-1, 1, 2)?
It may help if you paste the code into something like notepad before pasting into the browser. |
| |
09-19-2003, 03:53 AM
|
#9 (permalink)
|
Newb Techie Join Date: Sep 2003 Posts: 7
| No I dont have any code like the codee you posteddo you think this could be my problem?
I dont think that arrays can have a -1 element in them can they ?
hope to hear from you soon |
| |
09-24-2003, 03:20 PM
|
#10 (permalink)
|
True Techie Join Date: Sep 2003 Posts: 125
| as far as im away arrays cannot go into a negative or non existant value such as -1. 0 is the lowest an array can go so setting it below zero will cause errors.
__________________ ----------------------------------------------
@>~~~>~~~
Knight of the Roses
~~~<~~~<@
----------------------------------------------
Asus A7N8X Deluxe
Athlon 2600+ Thoroughbred
Corsair TWINX512-2700LL
GeForce 4 ti 4200 128mb
Maxtor 40gb 7200rpm
plextor 48x24x48 |
| |  | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | |