Ver Mensaje Individual
  #13 (permalink)  
Antiguo 14/12/2004, 15:00
Avatar de u_goldman
u_goldman
Moderador
 
Fecha de Ingreso: enero-2002
Mensajes: 8.031
Antigüedad: 22 años, 4 meses
Puntos: 98
Algo como esto utilizando arreglos, no lo he probado y le hice unas adecuaciones je je je, por lo cual seguramente tendrá algun error, pero ahí está la idea.

Código:
'Función para ordenar un arreglo, método de la burbuja
Function OrdenaArreglo(arreglo)
	If isArray(arreglo) Then
		Dim temp
		For i = 0 to uBound(arreglo)
			For j = i + 1 to uBound(arreglo)		
				If arreglo(i) > arreglo(j) Then
					temp = arreglo(i)
					arreglo(i) = arreglo(j)
					arreglo(j) = temp
				End If
			Next
		Next
	Else
		OrdenaArreglo = Null
	End If
	OrdenaArreglo = arreglo
End Function




Set rs = Server.createObject....bla bla
strSQL = "Select numeros FROM tabla1"
rs.Open strSQL, ObjConn, 3, 3

temp = ""
While Not rs.EOF
  If not IsNull(rs("numeros")) Then
    temp = temp & ","
  End If
  rs.MoveNext
Wend

If temp <> "" Then
  temp = left(temp, len(temp) - 1)
  arrTemp = split(temp, ",")
  Dim intArrTemp()
  For i = 0 to uBound(arrTemp)
     intArrTemp(i) = Cint(arrTemp(i))
  Next
  MiArreglo = OrdenaArreglo(intArrTemp)
  If Not IsNull(MiArreglo)
     'Lo muestras
  End If
End If
Salu2,
__________________
"El hombre que ha empezado a vivir seriamente por dentro, empieza a vivir más sencillamente por fuera."
-- Ernest Hemingway