Ciao; perchè qeusto script restituisce:
Error Type:
Microsoft VBScript runtime (0x800A0009)
Subscript out of range: 'indx'
/den/Info_Drv_sch.asp, line 111
Line 111 :
js(indx) = tmp + js(indx-1)
codice:Set oRs0 = oConn.Execute("SELECT DISTINCT tot_day_hrs AS Tot FROM schedule WHERE [Driver_ID]= "&rs9("Driver_ID")&" and shift_interval=1 and tot_day_hrs <> 0 ") Set oRs1 = oConn.Execute("SELECT DISTINCT tot_day_hrs AS Tot1 FROM schedule WHERE [Driver_ID]= "&rs9("Driver_ID")&" and shift_interval=2 and tot_day_hrs <> 0 ") while not oRs0.EOF tmp="" tmp1="" if len(trim(oRs0("Tot"))) > 2 Then ji= split(trim(oRs0("Tot")),".")(1) if left(ji,1) <> "0" and len(ji) = 1 Then ji = ji & "0" tmp = ji js(indx) = tmp + js(indx-1) else ji = ji tmp = ji js(indx) = tmp + js(indx-1) 'response.Write(js(indx) & " " & tmp ) End if ji1= split(oRs0("Tot"),".")(0) tmp1 = ji1 js1(indx) = tmp1 + js1(indx-1) indx = indx + 1 elseif (len(trim(oRs0("Tot"))) < 2 and trim(oRs0("Tot")) <> 0 ) Then 'Mins tmp = trim(oRs0("Tot")) js(indx) = 0 'Hour js1(indx) = tmp + js1(indx-1) indx = indx + 1 else js(indx) = 0 js1(indx) = 0 indx = indx + 1 End if oRs0.MoveNext wend

Rispondi quotando