LittleBobbyTables is right, you have to change the settings.
I think that depending on your inputs an additional object check may solve your problem.
function array_merge(left, right)
dim right_size
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 = array()
redim merged(total_size)
dim counter : counter = 0
for i = lbound(left) to ubound(left)
if isobject(left(i))then
set merged(counter) = left(i)
else
merged(counter) = left(i)
end if
counter=counter+1
next
for i = lbound(right) to ubound(right)
if isobject(right(i))then
set merged(counter) = right(i)
else
merged(counter) = right(i)
end if
next
''// Return value
array_merge = merged
end function
Some test codes:
dim a: a=100
dim b: b=200
dim c: set c=nothing
dim d: set d=nothing
dim e: set e=server.createobject("scripting.filesystemobject")
dim f: set f=server.createobject("scripting.filesystemobject")
dim x,y,z,zz
x = array_merge(a,b)
y = array_merge(c,d)
z = array_merge(e,f)
zz = array_merge(a,e)
response.write x(0)
response.write x(1)
''// Accessing Nothing Values throw Error
''//response.write y(0)
''//response.write y(1)
response.write z(0).GetExtensionName("test.doc")
response.write z(1).GetExtensionName("test.doc")
response.write zz(0)
response.write zz(1).GetExtensionName("test.doc")