Sto lavorando su una funzione array_merge per ASP classic. Quello che sembra sembra funzionare, fino a quando uno (o entrambi) parametri sono vuoti o non matrici. Ecco quello che ho finora:Array merge in ASP classic
function array_merge(left, right)
dim total_size
dim i
dim merged
' Convert "left" to an array
if not isArray(left) then
left = Array(left)
end if
' Convert "right" to an array
if not isArray(right) then
right = Array(right)
end if
' Start with "left" and add the elements of "right"
right_size = ubound(right)
total_size = ubound(left) + right_size + 1
merged = left
redim preserve merged(total_size)
for i = 0 to ubound(right)
merged(right_size + i + 1) = right(i)
next
' Return value
array_merge = merged
end function
ottengo l'errore:
Error Type: Microsoft VBScript runtime (0x800A01B6) Object doesn't support this property or method: 'merged' /_inc/nav/left-nav.inc, line 21
Dalla linea merged(right_size + i + 1) = right(i)
. Qualche saggezza su dove sto andando male?
Qual è stato l'input quando hai ricevuto quell'errore? –
Basta lanciare questo fuori là - 'SINISTRA' e' DESTRA' sono funzioni in VBScript. È possibile che il codice sia in realtà barfing su 'right (i)'? Potresti voler cambiare i nomi dei parametri della funzione. – LittleBobbyTables