Hi,

I have a error that I cannot figure out, and I am not too familiar with VB code, and I am pretty sure it is really obvious what the problem is but I have no idea what is causing it or how to fix it, so any help, hints, clues or suggestions would be great

Error:
Microsoft VBScript runtime error '800a0009'

Subscript out of range: '16'

/quote/temp_screenprintquote_results1.asp, line 67

(thank you for taking the time to read this huge email and trying to figure out my crazy hacked code)

Code:
<%
Dim numCT
shirt = request.form("shirt")
price = request.form("pricew")
numC = CLNG( request("numberOfColors") )
numCb = CLNG( request("numberOfColorsb") )
numCr = CLNG( request("numberOfColorsr") )
numCl = CLNG( request("numberOfColorsl") )
qty = CLNG( request("quantityOrdered") )
numCT = (numC + numCb + numCr + numCl)
%>

<%
dim total
Dim colorPriceTable
colorPriceTable =Array(_
Array(6, 12, 24, 48, 72, 144, 288, 500, 1000, 2001, 999999),_
Array(4, 2.5, 1.6, 1.15, 1.1, .9, .75, .65, .6, .55, .5),_
Array(7, 3.1, 2.45, 1.9, 1.5, 1.35, 1, .85, .8, .7, .65),_
Array(8.5, 4, 3, 2.85, 1.95, 1.65, 1.45, 1.3, 1, .85, .8),_
Array(10.5, 4.7, 3.6, 3.45, 2.35, 1.9, 1.7, 1.6, 1.3, 1, .9),_
Array(12, 5.4, 4.25, 4.05, 2.75, 2.2, 1.95, 1.9, 1.5, 1.15, 1),_
Array(13, 6.3, 5.05, 4.75, 3.35, 2.7, 2.35, 2.2, 1.7, 1.3, 1.1),_
Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)_
)

priceRow = colorPriceTable(numC)
priceRowb = colorPriceTable(numCb)
priceRowr = colorPriceTable(numCr)
priceRowl = colorPriceTable(numCl)
priceRowt = colorPriceTable(numCT)

qtyRow = colorPriceTable(0)

if numC = 7 Then
unitPrice = 0
End If

if numCb = 7 Then
unitPriceb = 0
End If

if numCr = 7 Then
unitPricer = 0
End If

if numCl = 7 Then
unitPricel = 0
End If

if numCT = 7 Then
unitPriceT = 0
End If

unitPrice = 0
usecol = 0

For col = 0 To UBound(qtyRow)
If qty < qtyRow(col) Then
unitPrice = priceRow(col)
unitPriceb = priceRowb(col)
unitPricer = priceRowr(col)
unitPricel = priceRowl(col)
unitPriceT = priceRowt(col)
Exit For
End If

Next
if numC = 7 Then
numC = 0
End If

if numCb = 7 Then
numCb = 0
End If

if numCr = 7 Then
numCr = 0
End If

if numCl = 7 Then
numCl = 0
End If

if numCT = 7 Then
numCT = 0
End If

total = ((((unitPriceT * qty) + (price * qty) + (.25 * qty))* 1.54) + (numCT * 22))
%>

Thanks Again and hopefully your headache is not too bad

Jen