Ver Mensaje Individual
  #16 (permalink)  
Antiguo 08/06/2005, 11:53
Avatar de u_goldman
u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 23 años, 4 meses
Puntos: 98
De verdad?? pero que error te dio? iteraste cada indice del arreglo y por cada indice el arreglo en si?

Deja ver si encuentro el script original y lo pongo aqui

Salu2,

Editando: Agrego el codigo original, a ver si junciona

Código:
<%
Function generaArregloPadre(arreglo, strCaracter)
	Dim indices
	Dim i
	Dim j
	Dim x
	Dim tempArr()
	indices = 0
	if isArray(arreglo) then
		redim preserve arreglo(uBound(arreglo) + 1)
		arreglo(uBound(arreglo)) = strCaracter
		for j = 0 to uBound(arreglo)
			if arreglo(j) = strCaracter then
				indices = indices + 1
			end if
		next
		'Response.Write "Numero de indices arreglo padre : " & indices & "<br>"
		Dim ds()
		redim ds(indices)
		i = 0
		x = 0
		for j = 0 to uBound(arreglo)
			if arreglo(j) <> strCaracter then
				'Response.Write("Redimensionamos arreglo temporal: tempArr("&x&")" & "<br>")
				redim preserve tempArr(x)
				'Response.Write("Asignamos valor: tempArr("&x&") = " & "arreglo("&j&")" & "<br><hr>")
				tempArr(x) = arreglo(j)
				x = x + 1
			else
				x = 0
				'Response.Write("<b>Asignamos arreglo a indice del arreglo padre: ds("&i&") = " & typename(tempArr) & "</b><br>")
				ds(i) = tempArr
				'Response.Write("redimensionamos arreglo temporal: temparr("&x&")")
				redim tempArr(x)
				i = i + 1
			end if
		next
	else
		ds = null
	end if
	generaArregloPadre = ds
End Function

Arreglo_Base = array("1","2","3","@","13","14","15","16","@","20","21")
dataset = generaArregloPadre(Arreglo_Base, "@")

for j = 0 to uBound(dataset)
	if isArray(dataset(j)) then
		Response.Write "| "	
		for i = 0 to uBound(dataset(j))
			Response.Write dataset(j)(i) & ","
		next
	end if
next
%>
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway

Última edición por u_goldman; 08/06/2005 a las 12:52